[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Hardware trap while casting large doubles to int on PowerPC P2020
- From: Thomas Jericke <tjericke@...>
- Date: Fri, 07 Mar 2014 10:00:18 +0000
On 03/07/2014 09:50 AM, Philipp Janda wrote:
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.
188.8.131.52 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.
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 ...
We were surprised that only we encountered the problem. I haven't found
anything on the list about it.