[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua 5.3.0 (work1) now available
- From: Enrico Colombini <erix@...>
- Date: Sat, 06 Jul 2013 22:40:50 +0200
On 06/07/2013 21.36, Roberto Ierusalimschy wrote:
There are two formats for reading numbers: io.read("*n") always reads
a floating-point number, and io.read("*i") always reads an integer.
So, usually there is no need to convert anything.
Just after the section "Mathematical Functions", the manual says this:
"Unless stated otherwise, all functions in this library operate with and
return floating-point numbers."
In that case it would probably be useful to retouch the description of
math.floor (etc.) to avoid them being interpreted as returning an integer:
Returns the largest integer smaller than or equal to x.
(yes, it doesn't say "as an integer number" but the "integer" word in
the above sentence could be confusing.)
> There is a new function, math.ifloor, that returns the floor as an
Right, missed that :-)