lua-users home
lua-l archive

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


On 03/07/2014 09:50 AM, Philipp Janda wrote:

3.2.1.3 Floating and integral

When a value of floating type is converted to integral type, the fractional part is discarded. If the value of the integral part cannot be represented by the integral type, the behavior is undefined. /23/

Footnote /23/ is:
23. The remaindering operation done when a value of integral type is converted to unsigned type need not be done when a value of floating type is converted to unsigned type. Thus the range of portable values is [0, U type _MAX +1).

Looks clear-cut to me ...


Philipp
Oh well, then I looked at the wrong place. So the behavior is undefined, this means the P2020 is doing nothing that isn't allowed here, and maybe the code in the vanilla Lua source should be changed accordingly.

We were surprised that only we encountered the problem. I haven't found anything on the list about it.

--
Thomas