On Mon, 11 Feb 2013 09:43:36 +0100, Remi Collet <r...@fedoraproject.org>
wrote:
Le 10/02/2013 20:27, Gustavo Lopes a écrit :
Any reservations?
For which values ? Outside LONG_MIN .. ULONG_MAX ?
It should be valid for the whole domain, but for performance reasons it
would be better to limit it to values at least outside the (LONG_MIN,
LONG_MAX) interval. Testing also against LONG_MIN has a measurable
performance hit in my tests (+40%), but that should not matter (on my old
laptop, you can still run the inlined function 1e9 times per second for
values in the long range, i.e., it takes around 1 ns).
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.
Sure, that is also an option, but since we already have a wrapping
behavior in the LONG_MAX..ULONG_MAX range, it would make sense to keep a
similar behavior throughout the double domain, I think. It would be
inconsistent to have it wrap on LONG_MAX, but for values smaller than
LONG_MIN or larger than ULONG_MAX give a fixed value.
--
Gustavo Lopes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php