Re: [VOTE][RFC] intdiv()

From: Date: Sun, 03 Aug 2014 14:27:48 +0000
Subject: Re: [VOTE][RFC] intdiv()
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-76322@lists.php.net to get a copy of this message
On 03/08/14 13:49, Andrea Faulds 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. Your missing the point I was trying to make. That "(int)(3 / 2)" essentially goes wrong only on 64bit systems is the bug that needs fixing. The mistake is having now to use intdiv() just in case an overflow does occur which was not present on the 32bit version? -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

« previous php.internals (#76322) next »