Increase String::num default decimal precision

Fixes #34541

Renamed MAX_DIGITS to MAX_DECIMALS, since it only changes the
amount of digits after the decimal point.

Increased MAX_DECIMALS to 32, and made String::num use
MAX_DECIMALS consistently. If -1 is passed as
decimal precision to String::num, it now gets changed to
the correct precision based on the number's magnitude,
instead of using printf default(which is 6)

String::num_real also calculates the correct precision now.

Also made the types used in floating-point math more
consistent in a few places.
This commit is contained in:
Heikki Simojoki
2019-12-23 17:38:33 +02:00
committed by Aaron Franke
parent b63f9b5961
commit 09a905ca80
7 changed files with 47 additions and 22 deletions

View File

@ -240,10 +240,10 @@
</method>
</methods>
<constants>
<constant name="PI" value="3.141593">
<constant name="PI" value="3.14159265358979">
Constant that represents how many times the diameter of a circle fits around its perimeter. This is equivalent to [code]TAU / 2[/code].
</constant>
<constant name="TAU" value="6.283185">
<constant name="TAU" value="6.28318530717959">
The circle constant, the circumference of the unit circle in radians.
</constant>
<constant name="INF" value="inf">