Difference between revisions of "Integer Divide Operator"
From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight") |
|||
(One intermediate revision by one other user not shown) | |||
Line 6: | Line 6: | ||
Divide a number to a whole number. | Divide a number to a whole number. | ||
− | a=b '''//''' c | + | a=b '''//''' c, put the integer result of divide 'b' by 'c' into 'a' |
=== Examples === | === Examples === | ||
<syntaxhighlight 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) | ||
− | </ | + | </syntaxhighlight> |
'''Make an integer out of any numbers''' | '''Make an integer out of any numbers''' | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
b=5.123 | b=5.123 | ||
− | a=b//1 -- result: a=5 (unique to | + | a=b//1 -- result: a=5 (unique to Gideros!) |
− | </ | + | </syntaxhighlight> |
{{GIDEROS IMPORTANT LINKS}} | {{GIDEROS IMPORTANT LINKS}} |