Re: [RFC] Integer Semantics

From: Date: Wed, 20 Aug 2014 09:20:20 +0000
Subject: Re: [RFC] Integer Semantics
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-76721@lists.php.net to get a copy of this message
On 20 Aug 2014, at 06:52, Dmitry Stogov <dmitry@zend.com> wrote: > 1) INF conversion to zero seems wrong. May be +INF should be converted to MAX_LONG and -INF to > MIN_LONG? I think of Infinity as more of an error value than an actual number. Not using MAX_LONG and MIN_LONG means it casts to the same value matter how large the integer type is, and it happens to be what JavaScript casts Infinity to. There’s also the fringe benefit that 1/0’s result in PHP, FALSE, casts to zero, as Infinity now would also, which is the standard IEEE 754 result for 1/0. > 3) a bit unrelated, but it also may make sense to introduce a logical right shift operator > (>>> in Java) How would that function? -- Andrea Faulds http://ajf.me/

« previous php.internals (#76721) next »