A good example for IEEE infinity

David Hough dgh
Wed Apr 4 14:42:44 PDT 1990


While researching another issue in the 80387 PRM,
I found a good example of why you'd want to have
an exact infinity in a floating-point number system,
as opposed to a big number.

The issue is calculating the equivalent resistance
of two resistors in parallel, R1 and R2.  The
simplest formula is 1/(1/R1 + 1/R2).  It gives
the exact correct answer (0) when R1 or R2 is zero.
Neither terminating on 1/0 nor returning some large
finite value would be as helpful.

You could argue that the formula isn't very good;
another is (R1 * R2)/(R1 + R2) which works OK if
only one of R1 and R2 are zero, but not both.
And this formula doesn't generalize very conveniently
to n parallel resistors.



More information about the Numeric-interest mailing list