Difference between revisions of "Integer Divide Operator"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 9: Line 9:
  
 
=== Examples ===
 
=== Examples ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
a=b//c -- faster than a=math.floor(b/c)
 
a=b//c -- faster than a=math.floor(b/c)
 
</source>
 
</source>
  
 
'''Make an integer out of any numbers'''
 
'''Make an integer out of any numbers'''
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
b=5.123
 
b=5.123
 
a=b//1 -- result: a=5 (unique to gideros!)
 
a=b//1 -- result: a=5 (unique to gideros!)

Revision as of 14:28, 13 July 2023

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.png
Available since: Gideros 2017.10

Description

Divide a number to a whole number.

a=b // c   put the integer result of divide 'b' by 'c' into 'a'

Examples

<syntaxhighlight lang="lua"> a=b//c -- faster than a=math.floor(b/c) </source>

Make an integer out of any numbers <syntaxhighlight lang="lua"> b=5.123 a=b//1 -- result: a=5 (unique to gideros!) </source>