summaryrefslogtreecommitdiff
path: root/doc/classes/float.xml
blob: f75c13003994069b7e26b186f7f2f7f7bb2903c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<?xml version="1.0" encoding="UTF-8" ?>
<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>
				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>
				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>
				Multiplies two [float]s.
			</description>
		</method>
		<method name="operator *" qualifiers="operator">
			<return type="Vector2">
			</return>
			<argument index="0" name="right" type="Vector2">
			</argument>
			<description>
				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>
				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>
				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>
				Multiplies each component of the [Vector3i] by the given [float].
			</description>
		</method>
		<method name="operator *" qualifiers="operator">
			<return type="Quaternion">
			</return>
			<argument index="0" name="right" type="Quaternion">
			</argument>
			<description>
				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>
				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>
				Multiplies a [float] and an [int]. The result is a [float].
			</description>
		</method>
		<method name="operator +" qualifiers="operator">
			<return type="float">
			</return>
			<description>
				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>
				Adds two floats.
			</description>
		</method>
		<method name="operator +" qualifiers="operator">
			<return type="float">
			</return>
			<argument index="0" name="right" type="int">
			</argument>
			<description>
				Adds a [float] and an [int]. The result is a [float].
			</description>
		</method>
		<method name="operator -" qualifiers="operator">
			<return type="float">
			</return>
			<description>
				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>
				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>
				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>
				Divides two floats.
			</description>
		</method>
		<method name="operator /" qualifiers="operator">
			<return type="float">
			</return>
			<argument index="0" name="right" type="int">
			</argument>
			<description>
				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>
				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>
				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>
				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>
				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>
				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>
				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>
				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>
				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>
				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>
				Returns [code]true[/code] if this [float] is greater than or equal to the given [int].
			</description>
		</method>
	</methods>
	<constants>
	</constants>
</class>