diff options
author | Heikki Simojoki <heikki.simojoki@gmail.com> | 2019-12-23 17:38:33 +0200 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2021-05-29 11:24:57 -0400 |
commit | 09a905ca8066c86951b23023a9e1950f277ae8f4 (patch) | |
tree | 8dd07afa6032e2cbd7349a94251676bd15500f63 /modules/gdscript | |
parent | b63f9b59615a4a63f1a45564d78243a2929c3c03 (diff) |
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.
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/doc_classes/@GDScript.xml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 9e974b6fdc..58620f2b3e 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -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"> |