From 7c88d6d7e7b258a118edea2feb23a16be90a49e6 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Mon, 12 Jan 2026 21:04:26 +0100 Subject: [PATCH] Add missing truthiness documentation --- doc/classes/Array.xml | 1 + doc/classes/Basis.xml | 1 + doc/classes/Callable.xml | 1 + doc/classes/Dictionary.xml | 1 + doc/classes/PackedByteArray.xml | 1 + doc/classes/PackedColorArray.xml | 1 + doc/classes/PackedFloat32Array.xml | 1 + doc/classes/PackedFloat64Array.xml | 1 + doc/classes/PackedInt32Array.xml | 1 + doc/classes/PackedInt64Array.xml | 1 + doc/classes/PackedStringArray.xml | 1 + doc/classes/PackedVector2Array.xml | 1 + doc/classes/PackedVector3Array.xml | 1 + doc/classes/PackedVector4Array.xml | 1 + doc/classes/Plane.xml | 1 + doc/classes/Projection.xml | 1 + doc/classes/Quaternion.xml | 1 + doc/classes/RID.xml | 1 + doc/classes/Signal.xml | 1 + doc/classes/Transform2D.xml | 1 + doc/classes/Transform3D.xml | 1 + doc/classes/float.xml | 1 + 22 files changed, 22 insertions(+) diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 3302e746dc..e3e70f0327 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -37,6 +37,7 @@ [/codeblocks] [b]Note:[/b] Arrays are always passed by [b]reference[/b]. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. [b]Note:[/b] Erasing elements while iterating over arrays is [b]not[/b] supported and will result in unpredictable behavior. + [b]Note:[/b] In a boolean context, an array will evaluate to [code]false[/code] if it's empty ([code][][/code]). Otherwise, an array will always evaluate to [code]true[/code]. [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedInt64Array] versus [code]Array[int][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index 55aa6ffc19..cc249efba1 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -15,6 +15,7 @@ For a general introduction, see the [url=$DOCS_URL/tutorials/math/matrices_and_transforms.html]Matrices and transforms[/url] tutorial. [b]Note:[/b] Godot uses a [url=https://en.wikipedia.org/wiki/Right-hand_rule]right-handed coordinate system[/url], which is a common standard. For directions, the convention for built-in types like [Camera3D] is for -Z to point forward (+X is right, +Y is up, and +Z is back). Other objects may use different direction conventions. For more information, see the [url=$DOCS_URL/tutorials/assets_pipeline/importing_3d_scenes/model_export_considerations.html#d-asset-direction-conventions]3D asset direction conventions[/url] tutorial. [b]Note:[/b] The basis matrices are exposed as [url=https://www.mindcontrol.org/~hplus/graphics/matrix-layout.html]column-major[/url] order, which is the same as OpenGL. However, they are stored internally in row-major order, which is the same as DirectX. + [b]Note:[/b] In a boolean context, a basis will evaluate to [code]false[/code] if it's equal to [constant IDENTITY]. Otherwise, a basis will always evaluate to [code]true[/code]. $DOCS_URL/tutorials/math/index.html diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml index f52a403d41..7356d9f276 100644 --- a/doc/classes/Callable.xml +++ b/doc/classes/Callable.xml @@ -61,6 +61,7 @@ # This will work. tween.tween_callback(Callable.create(dictionary, "clear")) [/codeblock] + [b]Note:[/b] In a boolean context, a callable will evaluate to [code]false[/code] if it's null (see [method is_null]). Otherwise, a callable will always evaluate to [code]true[/code]. diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index b8c077a210..3e6e196e4c 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -168,6 +168,7 @@ [/codeblocks] [b]Note:[/b] Dictionaries are always passed by reference. To get a copy of a dictionary which can be modified independently of the original dictionary, use [method duplicate]. [b]Note:[/b] Erasing elements while iterating over dictionaries is [b]not[/b] supported and will result in unpredictable behavior. + [b]Note:[/b] In a boolean context, a dictionary will evaluate to [code]false[/code] if it's empty ([code]{}[/code]). Otherwise, a dictionary will always evaluate to [code]true[/code]. $DOCS_URL/tutorials/scripting/gdscript/gdscript_basics.html#dictionary diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index f373e982f1..7c0fcd065e 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -7,6 +7,7 @@ An array specifically designed to hold bytes. Packs data tightly, so it saves memory for large array sizes. [PackedByteArray] also provides methods to encode/decode various types to/from bytes. The way values are encoded is an implementation detail and shouldn't be relied upon when interacting with external apps. [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. In these cases the returned packed array is a copy, and changing it will [i]not[/i] affect the original value. To update a built-in property of this type, modify the returned array and then assign it to the property again. + [b]Note:[/b] In a boolean context, a packed array will evaluate to [code]false[/code] if it's empty. Otherwise, a packed array will always evaluate to [code]true[/code]. diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index 19a620aba0..df9994565f 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -7,6 +7,7 @@ An array specifically designed to hold [Color]. Packs data tightly, so it saves memory for large array sizes. [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedColorArray] versus [code]Array[Color][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. In these cases the returned packed array is a copy, and changing it will [i]not[/i] affect the original value. To update a built-in property of this type, modify the returned array and then assign it to the property again. + [b]Note:[/b] In a boolean context, a packed array will evaluate to [code]false[/code] if it's empty. Otherwise, a packed array will always evaluate to [code]true[/code]. diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index 4b0b330d60..21e32285f9 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -7,6 +7,7 @@ An array specifically designed to hold 32-bit floating-point values (float). Packs data tightly, so it saves memory for large array sizes. If you need to pack 64-bit floats tightly, see [PackedFloat64Array]. [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. In these cases the returned packed array is a copy, and changing it will [i]not[/i] affect the original value. To update a built-in property of this type, modify the returned array and then assign it to the property again. + [b]Note:[/b] In a boolean context, a packed array will evaluate to [code]false[/code] if it's empty. Otherwise, a packed array will always evaluate to [code]true[/code]. diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index e92502a695..c171825e5e 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -8,6 +8,7 @@ If you only need to pack 32-bit floats tightly, see [PackedFloat32Array] for a more memory-friendly alternative. [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedFloat64Array] versus [code]Array[float][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. In these cases the returned packed array is a copy, and changing it will [i]not[/i] affect the original value. To update a built-in property of this type, modify the returned array and then assign it to the property again. + [b]Note:[/b] In a boolean context, a packed array will evaluate to [code]false[/code] if it's empty. Otherwise, a packed array will always evaluate to [code]true[/code]. diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index 73c6f3e7fd..f2b1e63965 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -7,6 +7,7 @@ An array specifically designed to hold 32-bit integer values. Packs data tightly, so it saves memory for large array sizes. [b]Note:[/b] This type stores signed 32-bit integers, which means it can take values in the interval [code][-2^31, 2^31 - 1][/code], i.e. [code][-2147483648, 2147483647][/code]. Exceeding those bounds will wrap around. In comparison, [int] uses signed 64-bit integers which can hold much larger values. If you need to pack 64-bit integers tightly, see [PackedInt64Array]. [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. In these cases the returned packed array is a copy, and changing it will [i]not[/i] affect the original value. To update a built-in property of this type, modify the returned array and then assign it to the property again. + [b]Note:[/b] In a boolean context, a packed array will evaluate to [code]false[/code] if it's empty. Otherwise, a packed array will always evaluate to [code]true[/code]. diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index f3a725f59e..9d25688160 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -8,6 +8,7 @@ [b]Note:[/b] This type stores signed 64-bit integers, which means it can take values in the interval [code][-2^63, 2^63 - 1][/code], i.e. [code][-9223372036854775808, 9223372036854775807][/code]. Exceeding those bounds will wrap around. If you only need to pack 32-bit integers tightly, see [PackedInt32Array] for a more memory-friendly alternative. [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedInt64Array] versus [code]Array[int][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. In these cases the returned packed array is a copy, and changing it will [i]not[/i] affect the original value. To update a built-in property of this type, modify the returned array and then assign it to the property again. + [b]Note:[/b] In a boolean context, a packed array will evaluate to [code]false[/code] if it's empty. Otherwise, a packed array will always evaluate to [code]true[/code]. diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index 62828d8e97..509f5dee26 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -13,6 +13,7 @@ [/codeblock] [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedStringArray] versus [code]Array[String][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. In these cases the returned packed array is a copy, and changing it will [i]not[/i] affect the original value. To update a built-in property of this type, modify the returned array and then assign it to the property again. + [b]Note:[/b] In a boolean context, a packed array will evaluate to [code]false[/code] if it's empty. Otherwise, a packed array will always evaluate to [code]true[/code]. https://godotengine.org/asset-library/asset/2789 diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index 6afa7e8b8a..c60243a7fe 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -7,6 +7,7 @@ An array specifically designed to hold [Vector2]. Packs data tightly, so it saves memory for large array sizes. [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedVector2Array] versus [code]Array[Vector2][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. In these cases the returned packed array is a copy, and changing it will [i]not[/i] affect the original value. To update a built-in property of this type, modify the returned array and then assign it to the property again. + [b]Note:[/b] In a boolean context, a packed array will evaluate to [code]false[/code] if it's empty. Otherwise, a packed array will always evaluate to [code]true[/code]. https://godotengine.org/asset-library/asset/2723 diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index e3c8c24d45..3ffe8e7d27 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -7,6 +7,7 @@ An array specifically designed to hold [Vector3]. Packs data tightly, so it saves memory for large array sizes. [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedVector3Array] versus [code]Array[Vector3][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. In these cases the returned packed array is a copy, and changing it will [i]not[/i] affect the original value. To update a built-in property of this type, modify the returned array and then assign it to the property again. + [b]Note:[/b] In a boolean context, a packed array will evaluate to [code]false[/code] if it's empty. Otherwise, a packed array will always evaluate to [code]true[/code]. diff --git a/doc/classes/PackedVector4Array.xml b/doc/classes/PackedVector4Array.xml index 995ab553b3..825022b1c6 100644 --- a/doc/classes/PackedVector4Array.xml +++ b/doc/classes/PackedVector4Array.xml @@ -7,6 +7,7 @@ An array specifically designed to hold [Vector4]. Packs data tightly, so it saves memory for large array sizes. [b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedVector4Array] versus [code]Array[Vector4][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays. [b]Note:[/b] Packed arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate]. This is [i]not[/i] the case for built-in properties and methods. In these cases the returned packed array is a copy, and changing it will [i]not[/i] affect the original value. To update a built-in property of this type, modify the returned array and then assign it to the property again. + [b]Note:[/b] In a boolean context, a packed array will evaluate to [code]false[/code] if it's empty. Otherwise, a packed array will always evaluate to [code]true[/code]. diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index 254557b986..ba313c4cd2 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -5,6 +5,7 @@ Represents a normalized plane equation. [member normal] is the normal of the plane (a, b, c normalized), and [member d] is the distance from the origin to the plane (in the direction of "normal"). "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing. + [b]Note:[/b] In a boolean context, a plane will evaluate to [code]false[/code] if all its components equal [code]0[/code]. Otherwise, a plane will always evaluate to [code]true[/code]. $DOCS_URL/tutorials/math/index.html diff --git a/doc/classes/Projection.xml b/doc/classes/Projection.xml index fd9dd7446b..2dfeedf733 100644 --- a/doc/classes/Projection.xml +++ b/doc/classes/Projection.xml @@ -7,6 +7,7 @@ A 4×4 matrix used for 3D projective transformations. It can represent transformations such as translation, rotation, scaling, shearing, and perspective division. It consists of four [Vector4] columns. For purely linear transformations (translation, rotation, and scale), it is recommended to use [Transform3D], as it is more performant and requires less memory. Used internally as [Camera3D]'s projection matrix. + [b]Note:[/b] In a boolean context, a projection will evaluate to [code]false[/code] if it's equal to [constant IDENTITY]. Otherwise, a projection will always evaluate to [code]true[/code]. diff --git a/doc/classes/Quaternion.xml b/doc/classes/Quaternion.xml index 88262fd404..eebf0b5779 100644 --- a/doc/classes/Quaternion.xml +++ b/doc/classes/Quaternion.xml @@ -9,6 +9,7 @@ For a great introduction to quaternions, see [url=https://www.youtube.com/watch?v=d4EgbgTm0Bg]this video by 3Blue1Brown[/url]. You do not need to know the math behind quaternions, as Godot provides several helper methods that handle it for you. These include [method slerp] and [method spherical_cubic_interpolate], as well as the [code]*[/code] operator. [b]Note:[/b] Quaternions must be normalized before being used for rotation (see [method normalized]). [b]Note:[/b] Similarly to [Vector2] and [Vector3], the components of a quaternion use 32-bit precision by default, unlike [float] which is always 64-bit. If double precision is needed, compile the engine with the option [code]precision=double[/code]. + [b]Note:[/b] In a boolean context, a quaternion will evaluate to [code]false[/code] if it's equal to [constant IDENTITY]. Otherwise, a quaternion will always evaluate to [code]true[/code]. https://www.youtube.com/watch?v=d4EgbgTm0Bg diff --git a/doc/classes/RID.xml b/doc/classes/RID.xml index a5c3ddb48e..a6b11bc658 100644 --- a/doc/classes/RID.xml +++ b/doc/classes/RID.xml @@ -7,6 +7,7 @@ The RID [Variant] type is used to access a low-level resource by its unique ID. RIDs are opaque, which means they do not grant access to the resource by themselves. They are used by the low-level server classes, such as [DisplayServer], [RenderingServer], [TextServer], etc. A low-level resource may correspond to a high-level [Resource], such as [Texture] or [Mesh]. [b]Note:[/b] RIDs are only useful during the current session. It won't correspond to a similar resource if sent over a network, or loaded from a file at a later time. + [b]Note:[/b] In a boolean context, an RID will evaluate to [code]false[/code] if it has the invalid ID [code]0[/code]. Otherwise, an RID will always evaluate to [code]true[/code]. This is equivalent to calling [method is_valid]. diff --git a/doc/classes/Signal.xml b/doc/classes/Signal.xml index 41c6776199..3c30ec15e1 100644 --- a/doc/classes/Signal.xml +++ b/doc/classes/Signal.xml @@ -146,6 +146,7 @@ } [/csharp] [/codeblocks] + [b]Note:[/b] In a boolean context, a signal will evaluate to [code]false[/code] if it's null (see [method is_null]). Otherwise, a signal will always evaluate to [code]true[/code]. $DOCS_URL/getting_started/step_by_step/signals.html diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index f6ad505490..2d76180b22 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -8,6 +8,7 @@ The [member x] and [member y] axes form a 2×2 matrix, known as the transform's [b]basis[/b]. The length of each axis ([method Vector2.length]) influences the transform's scale, while the direction of all axes influence the rotation. Usually, both axes are perpendicular to one another. However, when you rotate one axis individually, the transform becomes skewed. Applying a skewed transform to a 2D sprite will make the sprite appear distorted. For a general introduction, see the [url=$DOCS_URL/tutorials/math/matrices_and_transforms.html]Matrices and transforms[/url] tutorial. [b]Note:[/b] Unlike [Transform3D], there is no 2D equivalent to the [Basis] type. All mentions of "basis" refer to the [member x] and [member y] components of [Transform2D]. + [b]Note:[/b] In a boolean context, a Transform2D will evaluate to [code]false[/code] if it's equal to [constant IDENTITY]. Otherwise, a Transform2D will always evaluate to [code]true[/code]. $DOCS_URL/tutorials/math/index.html diff --git a/doc/classes/Transform3D.xml b/doc/classes/Transform3D.xml index 702509b054..c898645d38 100644 --- a/doc/classes/Transform3D.xml +++ b/doc/classes/Transform3D.xml @@ -7,6 +7,7 @@ The [Transform3D] built-in [Variant] type is a 3×4 matrix representing a transformation in 3D space. It contains a [Basis], which on its own can represent rotation, scale, and shear. Additionally, combined with its own [member origin], the transform can also represent a translation. For a general introduction, see the [url=$DOCS_URL/tutorials/math/matrices_and_transforms.html]Matrices and transforms[/url] tutorial. [b]Note:[/b] Godot uses a [url=https://en.wikipedia.org/wiki/Right-hand_rule]right-handed coordinate system[/url], which is a common standard. For directions, the convention for built-in types like [Camera3D] is for -Z to point forward (+X is right, +Y is up, and +Z is back). Other objects may use different direction conventions. For more information, see the [url=$DOCS_URL/tutorials/assets_pipeline/importing_3d_scenes/model_export_considerations.html#d-asset-direction-conventions]3D asset direction conventions[/url] tutorial. + [b]Note:[/b] In a boolean context, a Transform3D will evaluate to [code]false[/code] if it's equal to [constant IDENTITY]. Otherwise, a Transform3D will always evaluate to [code]true[/code]. $DOCS_URL/tutorials/math/index.html diff --git a/doc/classes/float.xml b/doc/classes/float.xml index 324a7756a2..789769622d 100644 --- a/doc/classes/float.xml +++ b/doc/classes/float.xml @@ -7,6 +7,7 @@ The [float] built-in type is a 64-bit double-precision floating-point number, equivalent to [code]double[/code] in C++. This type has 14 reliable decimal digits of precision. The maximum value of [float] is approximately [code]1.79769e308[/code], and the minimum is approximately [code]-1.79769e308[/code]. Many methods and properties in the engine use 32-bit single-precision floating-point numbers instead, equivalent to [code skip-lint]float[/code] 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 [code]precision=double[/code] option. Math done using the [float] type is not guaranteed to be exact and will often result in small errors. You should usually use the [method @GlobalScope.is_equal_approx] and [method @GlobalScope.is_zero_approx] methods instead of [code]==[/code] to compare [float] values for equality. + [b]Note:[/b] In a boolean context, a [float] will evaluate to [code]false[/code] if it's exactly equal to [code]0.0[/code], and to [code]true[/code] otherwise. https://en.wikipedia.org/wiki/Double-precision_floating-point_format