Interpreting the sign of zero

You've seen how infinite and NaN symbols in the number system lead to closure of the arithmetic operations. These are not the only symbols from outside the real number system. IEEE standard arithmetic, supported on every CommonPoint platform, also defines an algebraic sign for zero. Typically and behave identically in operations. One arbitrary case defined by the standard is . Another is that except when rounding toward , when the difference is .

However, the reciprocals of and are and , respectively, so that the implication does not apply. In some situations, the sign of zero is a valuable bit of information, particularly in complex arithmetic where points on the real or imaginary axis (that is, with one zero component) are associated with the half-plane on one or the other side of the axis, according to the sign of the zero component.

Normally, you need take no extra care with the sign of zero. But when you evaluate functions with poles, like the rational function below, you must be aware of the behavior of zero in reciprocation. Here is a rational function with two poles.

    float Bipolar(float x) { return ((x + 1) * (x + 2)) / ((x - 1) * (x - 2)); }
Bipolar(1.0) returns , while Bipolar(2.0) returns . When you depend on the results of division by zero, you need to care about the sign of that zero.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker