Log In  

flr x

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

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

Same as ([b]x - x%1[/b]) 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)

:: impbox

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)
:: jihem

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]

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-10-22 15:24 | 0.011s | 2097k | Q:13