[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.0 (work1) now available
- From: Owen Shepherd <owen.shepherd@...>
- Date: Sun, 07 Jul 2013 15:57:19 +0100
I completely agree with making it well defined, but wonder if rounding towards -inf is the most expected behavior (or perhaps most consistent)?
My personal inclination would be round towards zero, because it would be the most consistent behavior; that is, for any integral value i, tointeger(i / n) == i // n
Roberto Ierusalimschy wrote:
Because we expect conversions from floats to ints to be infrequent
in Lua with integers, we took the "luxury" to make them well behaved
operations. (Always rounds towards minus infinte, raise an error if
number is out of range. We also removed several system-dependent tricks
that Lua used to speed up those conversions.)