[M3devel] bugs in hand.c division

Roland Illig roland.illig at gmx.de
Sun Jan 17 08:49:45 CET 2010


Jay K schrieb:
> The gcc-4.2 -O2 case is for LONG_MIN / -1, which overflows.
> What is that supposed to equal?
> For any version that doesn't "crash", the result is LONG_MIN.

That's the best result one can get besides throwing an exception. With 
unlimited integers, the result would be LONG_MAX + 1, which equals 
LONG_MIN (modulo 2^BITSIZE(LONG)) when you are using two's complement 
arithmetics.

Roland



More information about the M3devel mailing list