lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> >   x == math.ifloor(x)    ?
> 
> If ifloor rounds that's very unexpected and unobvious behavior. I'd
> expect ifloor(0.9999999) to return 0, but ifloor(1.000001) to return
> 1. Meanwhile, I would expect, say, iround(0.9999999) to return 1.

I do not see what is the problem here. I could use iround, with the
same results. Whatever integer value the function returns for 0.9999999,
tha value is not going to be equal to 0.999999. What is unexpected here?

-- Roberto