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.



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


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



[Please log in to post a comment]