godot/doc/classes/float.xml

315 lines
9.1 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8" ?>
2020-02-01 01:03:48 +00:00
<class name="float" version="4.0">
<brief_description>
Float built-in type.
</brief_description>
<description>
Float built-in type.
</description>
<tutorials>
</tutorials>
<methods>
<method name="float" qualifiers="constructor">
<return type="float">
</return>
<description>
Constructs a default-initialized [float] set to [code]0.0[/code].
</description>
</method>
<method name="float" qualifiers="constructor">
<return type="float">
</return>
<argument index="0" name="from" type="float">
</argument>
<description>
Constructs a [float] as a copy of the given [float].
</description>
</method>
<method name="float" qualifiers="constructor">
<return type="float">
</return>
<argument index="0" name="from" type="bool">
</argument>
<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>
</method>
<method name="float" qualifiers="constructor">
<return type="float">
</return>
<argument index="0" name="from" type="int">
</argument>
<description>
Cast an [int] value to a floating-point value, [code]float(1)[/code] will be equal to [code]1.0[/code].
</description>
</method>
<method name="operator !=" qualifiers="operator">
<return type="bool">
</return>
<argument index="0" name="right" type="float">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Returns [code]true[/code] if two floats are different from each other.
</description>
</method>
<method name="operator !=" qualifiers="operator">
<return type="bool">
</return>
<argument index="0" name="right" type="int">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Returns [code]true[/code] if the integer has different value than the float.
</description>
</method>
<method name="operator *" qualifiers="operator">
<return type="float">
</return>
<argument index="0" name="right" type="float">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Multiplies two [float]s.
</description>
</method>
<method name="operator *" qualifiers="operator">
<return type="Vector2">
</return>
<argument index="0" name="right" type="Vector2">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Multiplies each component of the [Vector2] by the given [float].
[codeblock]
print(2.5 * Vector2(1, 1)) # Vector2(2.5, 2.5)
[/codeblock]
</description>
</method>
<method name="operator *" qualifiers="operator">
<return type="Vector2i">
</return>
<argument index="0" name="right" type="Vector2i">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Multiplies each component of the [Vector2i] by the given [float].
[codeblock]
print(2.0 * Vector2i(1, 1)) # Vector2i(2.0, 2.0)
[/codeblock]
</description>
</method>
<method name="operator *" qualifiers="operator">
<return type="Vector3">
</return>
<argument index="0" name="right" type="Vector3">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Multiplies each component of the [Vector3] by the given [float].
</description>
</method>
<method name="operator *" qualifiers="operator">
<return type="Vector3i">
</return>
<argument index="0" name="right" type="Vector3i">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Multiplies each component of the [Vector3i] by the given [float].
</description>
</method>
<method name="operator *" qualifiers="operator">
2021-01-20 07:02:02 +00:00
<return type="Quaternion">
</return>
2021-01-20 07:02:02 +00:00
<argument index="0" name="right" type="Quaternion">
</argument>
<description>
2021-01-20 07:02:02 +00:00
Multiplies each component of the [Quaternion] by the given [float].
</description>
</method>
<method name="operator *" qualifiers="operator">
<return type="Color">
</return>
<argument index="0" name="right" type="Color">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Multiplies each component of the [Color] by the given [float].
[codeblock]
print(1.5 * Color(0.5, 0.5, 0.5)) # Color(0.75, 0.75, 0.75)
[/codeblock]
</description>
</method>
<method name="operator *" qualifiers="operator">
<return type="float">
</return>
<argument index="0" name="right" type="int">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Multiplies a [float] and an [int]. The result is a [float].
</description>
</method>
<method name="operator +" qualifiers="operator">
<return type="float">
</return>
<description>
2021-01-06 00:13:11 +00:00
Unary plus operator. Doesn't have any effect.
[codeblock]
var a = +2.5 # a is 2.5.
[/codeblock]
</description>
</method>
<method name="operator +" qualifiers="operator">
<return type="float">
</return>
<argument index="0" name="right" type="float">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Adds two floats.
</description>
</method>
<method name="operator +" qualifiers="operator">
<return type="float">
</return>
<argument index="0" name="right" type="int">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Adds a [float] and an [int]. The result is a [float].
</description>
</method>
<method name="operator -" qualifiers="operator">
<return type="float">
</return>
<description>
2021-01-06 00:13:11 +00:00
Unary minus operator. Negates the number.
[codeblock]
var a = -2.5 # a is -2.5.
print(-a) # 2.5
[/codeblock]
</description>
</method>
<method name="operator -" qualifiers="operator">
<return type="float">
</return>
<argument index="0" name="right" type="float">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Subtracts a float from a float.
</description>
</method>
<method name="operator -" qualifiers="operator">
<return type="float">
</return>
<argument index="0" name="right" type="int">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Subtracts an [int] from a [float]. The result is a [float].
</description>
</method>
<method name="operator /" qualifiers="operator">
<return type="float">
</return>
<argument index="0" name="right" type="float">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Divides two floats.
</description>
</method>
<method name="operator /" qualifiers="operator">
<return type="float">
</return>
<argument index="0" name="right" type="int">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Divides a [float] by an [int]. The result is a [float].
</description>
</method>
<method name="operator &lt;" qualifiers="operator">
<return type="bool">
</return>
<argument index="0" name="right" type="float">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Returns [code]true[/code] the left float is less than the right one.
</description>
</method>
<method name="operator &lt;" qualifiers="operator">
<return type="bool">
</return>
<argument index="0" name="right" type="int">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Returns [code]true[/code] if this [float] is less than the given [int].
</description>
</method>
<method name="operator &lt;=" qualifiers="operator">
<return type="bool">
</return>
<argument index="0" name="right" type="float">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Returns [code]true[/code] the left integer is less than or equal to the right one.
</description>
</method>
<method name="operator &lt;=" qualifiers="operator">
<return type="bool">
</return>
<argument index="0" name="right" type="int">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Returns [code]true[/code] if this [float] is less than or equal to the given [int].
</description>
</method>
<method name="operator ==" qualifiers="operator">
<return type="bool">
</return>
<argument index="0" name="right" type="float">
</argument>
<description>
2021-01-06 00:13:11 +00:00
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.
</description>
</method>
<method name="operator ==" qualifiers="operator">
<return type="bool">
</return>
<argument index="0" name="right" type="int">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Returns [code]true[/code] if the [float] and the given [int] are equal.
</description>
</method>
<method name="operator &gt;" qualifiers="operator">
<return type="bool">
</return>
<argument index="0" name="right" type="float">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Returns [code]true[/code] the left float is greater than the right one.
</description>
</method>
<method name="operator &gt;" qualifiers="operator">
<return type="bool">
</return>
<argument index="0" name="right" type="int">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Returns [code]true[/code] if this [float] is greater than the given [int].
</description>
</method>
<method name="operator &gt;=" qualifiers="operator">
<return type="bool">
</return>
<argument index="0" name="right" type="float">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Returns [code]true[/code] the left float is greater than or equal to the right one.
</description>
</method>
<method name="operator &gt;=" qualifiers="operator">
<return type="bool">
</return>
<argument index="0" name="right" type="int">
</argument>
<description>
2021-01-06 00:13:11 +00:00
Returns [code]true[/code] if this [float] is greater than or equal to the given [int].
</description>
</method>
</methods>
<constants>
</constants>
</class>