Happy Happy Joy Joy (was: On to Hydro)

Jonathan S. Shapiro shap@eros-os.org
Mon, 21 Aug 2000 09:47:48 -0400


> ? Inf - Inf
>
> ??

I believe the IEEE spec calls for NaN as the answer.

In any case, all of these questions should be resolved by appeal to the IEEE
standard. From bitter experience, I can tell you that designing a better
arithmetic standard that generates different answers from the IEEE standard
is simply a bad idea. Customers will eventually make you fix it to conform,
and then you break everything.

Case in point: IBM did multiply-add units (MADD) on the RS-6000 that were
based internally on a hex implementation of the maintissa. They carried
extra precision internally between the multiplier and the adder, and in
consequence they sometimes delivered different answers than you would get if
you performed the operations sequentially.

The instruction was only used until people discovered this, whereupon they
carefully coded around it in spite of the improved performance (which was
significant).

shap