next up previous contents
Next: Operations with Up: Special Arithmetic Operations Previous: Special Arithmetic Operations   Contents

Signed zeros

Recall that the binary representation 0 has all mantissa and exponent bits zero. Depending on the sign bit, we may have or . Both are legal, and they are distinct; however, if and then the comparison returns .TRUE. for consistency.

The main reason for allowing signed zeros is to maintain consistency with the two types of infinity, and . In IEEE arithmetic, and . If we had a single, unsigned 0, with , then , and not as expected.

There are other good arguments in favor of signed zeros. For example, consider the function , discontinuous at ; we can consistently define the result to be based on the signum of .

Signed zeros have disadvantages also; for example, with and we have that but !



Adrian Sandu 2001-08-26