On Wed, Jul 16, 2014 at 7:34 PM, Andrea Faulds <a...@ajf.me> wrote:
> What are you suggesting you do for an integer division, then? ($a - ($a % 
> $b)) /
> $ b? The division operator already returns an integer. Or should I just use
> intdiv()?
>
Wow. I just finally understood what your RFC was going for.  I thought
you were trying to cover the case where ($a%$b)==0, but you're not,
you're trying to do truncated integer division regardless of
remainder.  I also missed the fact that div_function does the right
thing already as well. My bad for emailing from the bus.

Okay, that's another animal entirely.

Do we need a new operator for that?  It feels un-php to me, and the
kind of problem bigint objects should be meant to solve.  On the other
hand, having $a/$b != $a/$b (Off by more than 100 in this instance).
But back on the first hand, that's consistent with other operations on
large floats anyway.  PHP_INT_MAX + 1 != One more than PHP_INT_MAX,
for example.

-Sara

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to