Explorar o código

Mention that `int()` can be used as an alternative to `floor()`

Hugo Locurcio %!s(int64=5) %!d(string=hai) anos
pai
achega
1fcdeaee39
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      modules/gdscript/doc_classes/@GDScript.xml

+ 3 - 2
modules/gdscript/doc_classes/@GDScript.xml

@@ -336,11 +336,12 @@
 			<description>
 			<description>
 				Rounds [code]s[/code] to the closest smaller integer and returns it.
 				Rounds [code]s[/code] to the closest smaller integer and returns it.
 				[codeblock]
 				[codeblock]
-				# a is 2
+				# a is 2.0
 				a = floor(2.99)
 				a = floor(2.99)
-				# a is -3
+				# a is -3.0
 				a = floor(-2.99)
 				a = floor(-2.99)
 				[/codeblock]
 				[/codeblock]
+				[b]Note:[/b] This method returns a float. If you need an integer, you can use [code]int(s)[/code] directly.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="fmod">
 		<method name="fmod">