Attention: Here be dragons
This is the
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
A built-in type for floating point numbers.
The float built-in type is a 64-bit double-precision floating-point number, equivalent to
double in C++. This type has 14 reliable decimal digits of precision. The maximum value of float is approximately
1.79769e308, and the minimum is approximately
Many methods and properties in the engine use 32-bit single-precision floating-point numbers instead, equivalent to
float in C++, which have 6 reliable decimal digits of precision. For data structures such as Vector2 and Vector3, Godot uses 32-bit floating-point numbers by default, but it can be changed to use 64-bit doubles if Godot is compiled with the
Math done using the float type is not guaranteed to be exact and will often result in small errors. You should usually use the @GlobalScope.is_equal_approx and @GlobalScope.is_zero_approx methods instead of
== to compare float values for equality.
float ( )