summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorYuri Sizov <11782833+YuriSizov@users.noreply.github.com>2023-05-30 16:21:38 +0200
committerGitHub <noreply@github.com>2023-05-30 16:21:38 +0200
commitabba4e951a4a0c2fe845a98b02df1b54a8bcacee (patch)
tree44e0e20ecce0913259f38f5715252893ba750b99 /doc
parent2e1e78f3fcf850d7bd079ad23b27dd906eff4700 (diff)
parent5e3c625e24b32fbc91a3cb17f74a16d45f9a5a66 (diff)
downloadredot-engine-abba4e951a4a0c2fe845a98b02df1b54a8bcacee.tar.gz
Merge pull request #75614 from AThousandShips/vector_doc
Add more info on the nature of NAN
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/PackedFloat32Array.xml6
-rw-r--r--doc/classes/PackedFloat64Array.xml6
-rw-r--r--doc/classes/PackedVector2Array.xml6
-rw-r--r--doc/classes/PackedVector3Array.xml6
-rw-r--r--doc/classes/Vector2.xml6
-rw-r--r--doc/classes/Vector3.xml6
-rw-r--r--doc/classes/Vector4.xml6
-rw-r--r--doc/classes/float.xml6
8 files changed, 48 insertions, 0 deletions
diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml
index 54a483aac9..6e33ad8f73 100644
--- a/doc/classes/PackedFloat32Array.xml
+++ b/doc/classes/PackedFloat32Array.xml
@@ -53,6 +53,7 @@
<description>
Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [param before] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array.
[b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="clear">
@@ -66,6 +67,7 @@
<param index="0" name="value" type="float" />
<description>
Returns the number of times an element is in the array.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
@@ -87,6 +89,7 @@
<param index="1" name="from" type="int" default="0" />
<description>
Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="has" qualifiers="const">
@@ -94,6 +97,7 @@
<param index="0" name="value" type="float" />
<description>
Returns [code]true[/code] if the array contains [param value].
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="insert">
@@ -143,6 +147,7 @@
<param index="1" name="from" type="int" default="-1" />
<description>
Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="set">
@@ -173,6 +178,7 @@
<return type="void" />
<description>
Sorts the elements of the array in ascending order.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="to_byte_array" qualifiers="const">
diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml
index be178e1eac..844eae3019 100644
--- a/doc/classes/PackedFloat64Array.xml
+++ b/doc/classes/PackedFloat64Array.xml
@@ -53,6 +53,7 @@
<description>
Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [param before] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array.
[b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="clear">
@@ -66,6 +67,7 @@
<param index="0" name="value" type="float" />
<description>
Returns the number of times an element is in the array.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
@@ -87,6 +89,7 @@
<param index="1" name="from" type="int" default="0" />
<description>
Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="has" qualifiers="const">
@@ -94,6 +97,7 @@
<param index="0" name="value" type="float" />
<description>
Returns [code]true[/code] if the array contains [param value].
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="insert">
@@ -143,6 +147,7 @@
<param index="1" name="from" type="int" default="-1" />
<description>
Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="set">
@@ -173,6 +178,7 @@
<return type="void" />
<description>
Sorts the elements of the array in ascending order.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="to_byte_array" qualifiers="const">
diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml
index 1cfa11a314..0f74e0d2e5 100644
--- a/doc/classes/PackedVector2Array.xml
+++ b/doc/classes/PackedVector2Array.xml
@@ -53,6 +53,7 @@
<description>
Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [param before] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array.
[b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="clear">
@@ -66,6 +67,7 @@
<param index="0" name="value" type="Vector2" />
<description>
Returns the number of times an element is in the array.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
@@ -87,6 +89,7 @@
<param index="1" name="from" type="int" default="0" />
<description>
Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="has" qualifiers="const">
@@ -94,6 +97,7 @@
<param index="0" name="value" type="Vector2" />
<description>
Returns [code]true[/code] if the array contains [param value].
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="insert">
@@ -143,6 +147,7 @@
<param index="1" name="from" type="int" default="-1" />
<description>
Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="set">
@@ -173,6 +178,7 @@
<return type="void" />
<description>
Sorts the elements of the array in ascending order.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="to_byte_array" qualifiers="const">
diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml
index f6a012f35e..9d0fdaa717 100644
--- a/doc/classes/PackedVector3Array.xml
+++ b/doc/classes/PackedVector3Array.xml
@@ -52,6 +52,7 @@
<description>
Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [param before] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array.
[b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="clear">
@@ -65,6 +66,7 @@
<param index="0" name="value" type="Vector3" />
<description>
Returns the number of times an element is in the array.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
@@ -86,6 +88,7 @@
<param index="1" name="from" type="int" default="0" />
<description>
Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="has" qualifiers="const">
@@ -93,6 +96,7 @@
<param index="0" name="value" type="Vector3" />
<description>
Returns [code]true[/code] if the array contains [param value].
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="insert">
@@ -142,6 +146,7 @@
<param index="1" name="from" type="int" default="-1" />
<description>
Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="set">
@@ -172,6 +177,7 @@
<return type="void" />
<description>
Sorts the elements of the array in ascending order.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="to_byte_array" qualifiers="const">
diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml
index 6c9d96860a..cc406d9067 100644
--- a/doc/classes/Vector2.xml
+++ b/doc/classes/Vector2.xml
@@ -412,6 +412,7 @@
<description>
Returns [code]true[/code] if the vectors are not equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator *">
@@ -494,6 +495,7 @@
<param index="0" name="right" type="Vector2" />
<description>
Compares two [Vector2] vectors by first checking if the X value of the left vector is less than the X value of the [param right] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors. This operator is useful for sorting vectors.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator &lt;=">
@@ -501,6 +503,7 @@
<param index="0" name="right" type="Vector2" />
<description>
Compares two [Vector2] vectors by first checking if the X value of the left vector is less than or equal to the X value of the [param right] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors. This operator is useful for sorting vectors.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator ==">
@@ -509,6 +512,7 @@
<description>
Returns [code]true[/code] if the vectors are exactly equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator &gt;">
@@ -516,6 +520,7 @@
<param index="0" name="right" type="Vector2" />
<description>
Compares two [Vector2] vectors by first checking if the X value of the left vector is greater than the X value of the [param right] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors. This operator is useful for sorting vectors.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator &gt;=">
@@ -523,6 +528,7 @@
<param index="0" name="right" type="Vector2" />
<description>
Compares two [Vector2] vectors by first checking if the X value of the left vector is greater than or equal to the X value of the [param right] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors. This operator is useful for sorting vectors.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator []">
diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml
index d4ecf008f2..659707987d 100644
--- a/doc/classes/Vector3.xml
+++ b/doc/classes/Vector3.xml
@@ -435,6 +435,7 @@
<description>
Returns [code]true[/code] if the vectors are not equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator *">
@@ -531,6 +532,7 @@
<param index="0" name="right" type="Vector3" />
<description>
Compares two [Vector3] vectors by first checking if the X value of the left vector is less than the X value of the [param right] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, and then with the Z values. This operator is useful for sorting vectors.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator &lt;=">
@@ -538,6 +540,7 @@
<param index="0" name="right" type="Vector3" />
<description>
Compares two [Vector3] vectors by first checking if the X value of the left vector is less than or equal to the X value of the [param right] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, and then with the Z values. This operator is useful for sorting vectors.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator ==">
@@ -546,6 +549,7 @@
<description>
Returns [code]true[/code] if the vectors are exactly equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator &gt;">
@@ -553,6 +557,7 @@
<param index="0" name="right" type="Vector3" />
<description>
Compares two [Vector3] vectors by first checking if the X value of the left vector is greater than the X value of the [param right] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, and then with the Z values. This operator is useful for sorting vectors.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator &gt;=">
@@ -560,6 +565,7 @@
<param index="0" name="right" type="Vector3" />
<description>
Compares two [Vector3] vectors by first checking if the X value of the left vector is greater than or equal to the X value of the [param right] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, and then with the Z values. This operator is useful for sorting vectors.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator []">
diff --git a/doc/classes/Vector4.xml b/doc/classes/Vector4.xml
index a89663a54a..daeda011da 100644
--- a/doc/classes/Vector4.xml
+++ b/doc/classes/Vector4.xml
@@ -273,6 +273,7 @@
<description>
Returns [code]true[/code] if the vectors are not equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator *">
@@ -361,6 +362,7 @@
<param index="0" name="right" type="Vector4" />
<description>
Compares two [Vector4] vectors by first checking if the X value of the left vector is less than the X value of the [param right] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator &lt;=">
@@ -368,6 +370,7 @@
<param index="0" name="right" type="Vector4" />
<description>
Compares two [Vector4] vectors by first checking if the X value of the left vector is less than or equal to the X value of the [param right] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator ==">
@@ -376,6 +379,7 @@
<description>
Returns [code]true[/code] if the vectors are exactly equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator &gt;">
@@ -383,6 +387,7 @@
<param index="0" name="right" type="Vector4" />
<description>
Compares two [Vector4] vectors by first checking if the X value of the left vector is greater than the X value of the [param right] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator &gt;=">
@@ -390,6 +395,7 @@
<param index="0" name="right" type="Vector4" />
<description>
Compares two [Vector4] vectors by first checking if the X value of the left vector is greater than or equal to the X value of the [param right] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors.
+ [b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator []">
diff --git a/doc/classes/float.xml b/doc/classes/float.xml
index fa0d4e6367..293ba2eaf9 100644
--- a/doc/classes/float.xml
+++ b/doc/classes/float.xml
@@ -54,6 +54,7 @@
<param index="0" name="right" type="float" />
<description>
Returns [code]true[/code] if two floats are different from each other.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator !=">
@@ -215,6 +216,7 @@
<param index="0" name="right" type="float" />
<description>
Returns [code]true[/code] if the left float is less than the right one.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator &lt;">
@@ -229,6 +231,7 @@
<param index="0" name="right" type="float" />
<description>
Returns [code]true[/code] if the left float is less than or equal to the right one.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator &lt;=">
@@ -244,6 +247,7 @@
<description>
Returns [code]true[/code] if both floats are exactly equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method @GlobalScope.is_equal_approx] or [method @GlobalScope.is_zero_approx] instead, which are more reliable.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator ==">
@@ -258,6 +262,7 @@
<param index="0" name="right" type="float" />
<description>
Returns [code]true[/code] if the left float is greater than the right one.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator &gt;">
@@ -272,6 +277,7 @@
<param index="0" name="right" type="float" />
<description>
Returns [code]true[/code] if the left float is greater than or equal to the right one.
+ [b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this operator may not be accurate if NaNs are included.
</description>
</operator>
<operator name="operator &gt;=">