15-3. The Distribution of Leading Digits
When IBM introduced the System/360 computer in 1964, numerical analysts were horrified at the loss of precision of single-precision arithmetic. The previous IBM computer line, the 704 - 709 - 7090 family, had a 36-bit word. For single-precision floating-point, the format consisted of a 9-bit sign and exponent field, followed by a 27-bit fraction in binary. The most significant fraction bit was explicitly included (in “normal” numbers), so quantities were represented with a precision of 27 bits.
-0.0 = +0.0 (IEEE) | -0.0 < +0.0 (non-IEEE) |
---|---|
if (n >= 0) n = n+0x80000000; else n = -n; Use unsigned comparison. | if (n >= 0) n = n+0x80000000; ... |
Get Hacker's Delight now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.