modulus fn with negatives

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Tue Sep 11 02:41:21 AEST 1984


The "most negative number" is always a problem on 2's complement machines.
Rather than have every routine have a special case for this, we usually
prohibit it the same way we prohibit numbers larger than the largest.

Sometimes one can handle the "most negative number" without making a
special case; atoi() is an example (use a negative accumulator).



More information about the Comp.lang.c mailing list