Re: double val to long val conversion issue

From: Date: Mon, 11 Feb 2013 08:43:36 +0000
Subject: Re: double val to long val conversion issue
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-65769@lists.php.net to get a copy of this message
Le 10/02/2013 20:27, Gustavo Lopes a écrit : > Any reservations? Do we really want/need to change the current behavior. Cast from double, outside of integer range, result in a fix value. The only problem is that the value is not the same on all arch. x86_64 always return 0x8000... ppc64 returns LONG_MAX (0x7fff...) for signed value >= LONG_MAX LONG_MIN (0x8000...) for signed value <= LONG_MIN ULONG_MAX (0xffff...) for unsigned value >= ULONG_MAX NB. The current fix applied only fix LONG_MAX value. Cast for >= ULONG_MAX is not fixed. Note (my "very" personal opinion) I think ppc64 behavior is better as it preserve the sign of the result... ;) But Intel seems the "standard"... Remi.

« previous php.internals (#65769) next »