summaryrefslogtreecommitdiff
path: root/doc/classes/float.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/float.xml')
-rw-r--r--doc/classes/float.xml94
1 files changed, 57 insertions, 37 deletions
diff --git a/doc/classes/float.xml b/doc/classes/float.xml
index a7c6533ef5..a196021249 100644
--- a/doc/classes/float.xml
+++ b/doc/classes/float.xml
@@ -21,21 +21,28 @@
</constructor>
<constructor name="float">
<return type="float" />
- <argument index="0" name="from" type="float" />
+ <param index="0" name="from" type="float" />
<description>
Constructs a [float] as a copy of the given [float].
</description>
</constructor>
<constructor name="float">
<return type="float" />
- <argument index="0" name="from" type="bool" />
+ <param index="0" name="from" type="String" />
+ <description>
+ Converts a [String] to a [float], following the same rules as [method String.to_float].
+ </description>
+ </constructor>
+ <constructor name="float">
+ <return type="float" />
+ <param index="0" name="from" type="bool" />
<description>
Cast a [bool] value to a floating-point value, [code]float(true)[/code] will be equal to 1.0 and [code]float(false)[/code] will be equal to 0.0.
</description>
</constructor>
<constructor name="float">
<return type="float" />
- <argument index="0" name="from" type="int" />
+ <param index="0" name="from" type="int" />
<description>
Cast an [int] value to a floating-point value, [code]float(1)[/code] will be equal to [code]1.0[/code].
</description>
@@ -44,21 +51,21 @@
<operators>
<operator name="operator !=">
<return type="bool" />
- <argument index="0" name="right" type="float" />
+ <param index="0" name="right" type="float" />
<description>
Returns [code]true[/code] if two floats are different from each other.
</description>
</operator>
<operator name="operator !=">
<return type="bool" />
- <argument index="0" name="right" type="int" />
+ <param index="0" name="right" type="int" />
<description>
Returns [code]true[/code] if the integer has different value than the float.
</description>
</operator>
<operator name="operator *">
<return type="Color" />
- <argument index="0" name="right" type="Color" />
+ <param index="0" name="right" type="Color" />
<description>
Multiplies each component of the [Color] by the given [float].
[codeblock]
@@ -68,14 +75,14 @@
</operator>
<operator name="operator *">
<return type="Quaternion" />
- <argument index="0" name="right" type="Quaternion" />
+ <param index="0" name="right" type="Quaternion" />
<description>
Multiplies each component of the [Quaternion] by the given [float]. This operation is not meaningful on its own, but it can be used as a part of a larger expression.
</description>
</operator>
<operator name="operator *">
<return type="Vector2" />
- <argument index="0" name="right" type="Vector2" />
+ <param index="0" name="right" type="Vector2" />
<description>
Multiplies each component of the [Vector2] by the given [float].
[codeblock]
@@ -85,7 +92,7 @@
</operator>
<operator name="operator *">
<return type="Vector2" />
- <argument index="0" name="right" type="Vector2i" />
+ <param index="0" name="right" type="Vector2i" />
<description>
Multiplies each component of the [Vector2i] by the given [float]. Returns a [Vector2].
[codeblock]
@@ -95,14 +102,14 @@
</operator>
<operator name="operator *">
<return type="Vector3" />
- <argument index="0" name="right" type="Vector3" />
+ <param index="0" name="right" type="Vector3" />
<description>
Multiplies each component of the [Vector3] by the given [float].
</description>
</operator>
<operator name="operator *">
<return type="Vector3" />
- <argument index="0" name="right" type="Vector3i" />
+ <param index="0" name="right" type="Vector3i" />
<description>
Multiplies each component of the [Vector3i] by the given [float]. Returns a [Vector3].
[codeblock]
@@ -112,115 +119,128 @@
</operator>
<operator name="operator *">
<return type="Vector4" />
- <argument index="0" name="right" type="Vector4" />
+ <param index="0" name="right" type="Vector4" />
<description>
+ Multiplies each component of the [Vector4] by the given [float].
</description>
</operator>
<operator name="operator *">
<return type="Vector4" />
- <argument index="0" name="right" type="Vector4i" />
+ <param index="0" name="right" type="Vector4i" />
<description>
+ Multiplies each component of the [Vector4i] by the given [float]. Returns a [Vector4].
+ [codeblock]
+ print(0.9 * Vector4i(10, 15, 20, -10)) # Prints "(9, 13.5, 18, -9)"
+ [/codeblock]
</description>
</operator>
<operator name="operator *">
<return type="float" />
- <argument index="0" name="right" type="float" />
+ <param index="0" name="right" type="float" />
<description>
Multiplies two [float]s.
</description>
</operator>
<operator name="operator *">
<return type="float" />
- <argument index="0" name="right" type="int" />
+ <param index="0" name="right" type="int" />
<description>
Multiplies a [float] and an [int]. The result is a [float].
</description>
</operator>
<operator name="operator **">
<return type="float" />
- <argument index="0" name="right" type="float" />
+ <param index="0" name="right" type="float" />
<description>
+ Raises a [float] to a power of a [float].
+ [codeblock]
+ print(39.0625**0.25) # 2.5
+ [/codeblock]
</description>
</operator>
<operator name="operator **">
<return type="float" />
- <argument index="0" name="right" type="int" />
+ <param index="0" name="right" type="int" />
<description>
+ Raises a [float] to a power of an [int]. The result is a [float].
+ [codeblock]
+ print(0.9**3) # 0.729
+ [/codeblock]
</description>
</operator>
<operator name="operator +">
<return type="float" />
- <argument index="0" name="right" type="float" />
+ <param index="0" name="right" type="float" />
<description>
Adds two floats.
</description>
</operator>
<operator name="operator +">
<return type="float" />
- <argument index="0" name="right" type="int" />
+ <param index="0" name="right" type="int" />
<description>
Adds a [float] and an [int]. The result is a [float].
</description>
</operator>
<operator name="operator -">
<return type="float" />
- <argument index="0" name="right" type="float" />
+ <param index="0" name="right" type="float" />
<description>
Subtracts a float from a float.
</description>
</operator>
<operator name="operator -">
<return type="float" />
- <argument index="0" name="right" type="int" />
+ <param index="0" name="right" type="int" />
<description>
Subtracts an [int] from a [float]. The result is a [float].
</description>
</operator>
<operator name="operator /">
<return type="float" />
- <argument index="0" name="right" type="float" />
+ <param index="0" name="right" type="float" />
<description>
Divides two floats.
</description>
</operator>
<operator name="operator /">
<return type="float" />
- <argument index="0" name="right" type="int" />
+ <param index="0" name="right" type="int" />
<description>
Divides a [float] by an [int]. The result is a [float].
</description>
</operator>
<operator name="operator &lt;">
<return type="bool" />
- <argument index="0" name="right" type="float" />
+ <param index="0" name="right" type="float" />
<description>
- Returns [code]true[/code] the left float is less than the right one.
+ Returns [code]true[/code] if the left float is less than the right one.
</description>
</operator>
<operator name="operator &lt;">
<return type="bool" />
- <argument index="0" name="right" type="int" />
+ <param index="0" name="right" type="int" />
<description>
Returns [code]true[/code] if this [float] is less than the given [int].
</description>
</operator>
<operator name="operator &lt;=">
<return type="bool" />
- <argument index="0" name="right" type="float" />
+ <param index="0" name="right" type="float" />
<description>
- Returns [code]true[/code] the left integer is less than or equal to the right one.
+ Returns [code]true[/code] if the left float is less than or equal to the right one.
</description>
</operator>
<operator name="operator &lt;=">
<return type="bool" />
- <argument index="0" name="right" type="int" />
+ <param index="0" name="right" type="int" />
<description>
Returns [code]true[/code] if this [float] is less than or equal to the given [int].
</description>
</operator>
<operator name="operator ==">
<return type="bool" />
- <argument index="0" name="right" type="float" />
+ <param index="0" name="right" type="float" />
<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.
@@ -228,35 +248,35 @@
</operator>
<operator name="operator ==">
<return type="bool" />
- <argument index="0" name="right" type="int" />
+ <param index="0" name="right" type="int" />
<description>
Returns [code]true[/code] if the [float] and the given [int] are equal.
</description>
</operator>
<operator name="operator &gt;">
<return type="bool" />
- <argument index="0" name="right" type="float" />
+ <param index="0" name="right" type="float" />
<description>
- Returns [code]true[/code] the left float is greater than the right one.
+ Returns [code]true[/code] if the left float is greater than the right one.
</description>
</operator>
<operator name="operator &gt;">
<return type="bool" />
- <argument index="0" name="right" type="int" />
+ <param index="0" name="right" type="int" />
<description>
Returns [code]true[/code] if this [float] is greater than the given [int].
</description>
</operator>
<operator name="operator &gt;=">
<return type="bool" />
- <argument index="0" name="right" type="float" />
+ <param index="0" name="right" type="float" />
<description>
- Returns [code]true[/code] the left float is greater than or equal to the right one.
+ Returns [code]true[/code] if the left float is greater than or equal to the right one.
</description>
</operator>
<operator name="operator &gt;=">
<return type="bool" />
- <argument index="0" name="right" type="int" />
+ <param index="0" name="right" type="int" />
<description>
Returns [code]true[/code] if this [float] is greater than or equal to the given [int].
</description>