Re: [VOTE][RFC] intdiv()
| From: | Andrea Faulds | Date: | Sun, 03 Aug 2014 12:49:03 +0000 |
| Subject: | Re: [VOTE][RFC] intdiv() | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-76319@lists.php.net to get a copy of this message | ||
On 3 Aug 2014, at 13:24, Lester Caine <lester@lsces.co.uk> wrote:
> That the principle of sorting out 64 bit division is accepted is fairly
> obvious from the current stated of the vote? Personally I still view
> this as part of the general debate on just how 64bit integers are
> supported by default in new builds of PHP, in which situation, simply
> throwing a new operator at it is not fixing the basic fault in "(int)(3
> / 2)"? Having to decided is one needs a different operator on 64bit
> systems is still wrong what ever that operator is?
You don’t need a different operator on 64-bit systems, the point is that using (int) with / is an
ugly hack that just so happens to only break on 64-bit systems. You could do 3 %% 2 or intdiv(3, 2)
on both 32-bit or 64-bit.
--
Andrea Faulds
http://ajf.me/