Reputation: 47952
The inclusion of subnormal numbers in IEEE 754 was a controversial decision. In floating-point formats without subnormals, but with "hidden" 1 bits, how is/was 0 typically represented? Was an entire binade reserved for it, or was 0x00000000 in the lowest binade reserved as a special case? Or something else? (I suppose I should try booting up my old PDP-11, and see...)
Upvotes: 2
Views: 61
Reputation: 153517
Example: entire binade reserved for it
A not-so-old FP format with a hidden one bit treated the first byte as the biased exponent and when the biased exponent was 0, the value was 0.0, without consideration of the "23 bit mantissa". I do not recall properties of a -0.0.
CCS compilers used to use (~12 yrs ago) this for much of their FP, but now mostly use IEEE 754.
When non-zero, it was easy to removed the sign bit, "or" in the hidden 1 bit and process the value.
Upvotes: 2
Reputation: 222901
From the pdp11 processor handbook, pdp11/04/24/34a/44/70, 1981, EB-19402-20, page 310:
Because of the hidden bit, the fractional part is not available to distinguish between 0 and nonvanishing numbers whose fractional part is exactly ½. Therefore, the FP11 reserves a biased exponent of 0 for this purpose, and any floating point number with a biased exponent of 0 either traps or is treated as if it were an exact 0 in arithmetic operations. An exact or clean 0 is represented by a word whose bits are all 0s. A dirty 0 is a floating point number with a biased exponent of 0 and a nonzero fractional part.
It continues:
An arithmetic operation for which the resulting true exponent exceeds 2778 is regarded as producing a floating overflow; if the true exponent is less than −1778, the operation is regarded as produce a floating underflow. A biased exponent of 0 can thus arise from arithmetic operations as a special case of overflow (true exponent = −2008). Only eight bits are reserved for the biased exponent. The fractional part of results obtained from such overflow and underflow is correct.
The next paragraph describes any bit pattern with a sign bit of 1 and a biased exponent of 0 as an “undefined variable.” So there was no −0; that bit pattern would be a NaN.
Upvotes: 2