The standard also seems to say that "truncation towards zero" (or rather, the resulting equality) is only guaranteed if a/b is "representable" (which it isn't in Derrik's special case, is it?).At 23:49 22/02/2004 +0100, Michael Walter wrote: No, -2147483648 is the lower bound and 2147483647 is the upper bound for
signed integers.
-2147483648 = 10000000000000000000000000000000 2147483647 = 01111111111111111111111111111111
it still doesn't explain the FPE here. What does explain it is that -2147483648 / -1 = 2147483648 which is too large.
Doesn't the rval in modulus need to be unsigned?
No, it's implementation-defined though if one of the operands is negative, IIRC.
I checked the standard (not very thoroughly I admit) and it seems to only be undefined for 0.
> Can someone check this on a non-intel CPU with a 32bit int?
If an Athlon is non-intel enough for you, then there you have the same behaviour ;)
Cheers, Michael
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php