Log In  

flr x

Returns the closest integer below x
flr(-0.3) returns -1.0
Same as (x%1) for positive values of x

print(flr(1.3)) --> 1
print(1.3%1) --> 0.3

Same as (x - x%1) for positive values of x

This should be corrected in the manual.

P#18337 2016-01-17 15:35 ( Edited 2016-01-18 11:57)

Indeed, I suspect it meant x%1 in the C sense of integer modulo, not the lua sense of real modulo.

P#18342 2016-01-17 21:07 ( Edited 2016-01-18 02:07)

You're right but the documentation is about the pico language (lua) not C.
The newcomers may be lost in the translation...

P#18348 2016-01-18 06:57 ( Edited 2016-01-18 11:57)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 08:39:32 | 0.007s | Q:12