95% Completely Clueless: " of The Folks Out There Are About Floating-Point."
95% Completely Clueless: " of The Folks Out There Are About Floating-Point."
95% Completely Clueless: " of The Folks Out There Are About Floating-Point."
“95% of the
folks out there are
completely clueless about
floating-point.”
James Gosling
Sun Fellow
Java Inventor
1998-02-28
CS 314 Chapter 3.1 CSE, 2016
Goals for Floating Point
Standard arithmetic for reals for all computers
Like two’s complement
∞, NaN
Getting
closer to
zero
Zero
1989
ACM Turing
Award Winner! Prof. Kahan
www.cs.berkeley.edu/~wkahan/
…/ieee754status/754story.html
CS 314 Chapter 3.12 CSE, 2016
IEEE 754 FP Standard
Most (all?) computers these days conform to the IEEE 754
floating point standard (-1)sign x (1+F) x 2E-bias
Formats for both single and double precision
F is stored in normalized format where the msb in F is 1 (so there
is no need to store it!) – called the hidden bit
To simplify sorting FP numbers, E comes before F in the word and
E is represented in excess (biased) notation where the bias is -127
(-1023 for double precision) so the most negative is 00000001 =
21-127 = 2-126 and the most positive is 11111110 = 2254-127 = 2+127
How to represent 0?
exponent: all zeros
significand: all zeros
What about sign? Both cases valid.
+0: 0 00000000 00000000000000000000000
-0: 1 00000000 00000000000000000000000
0 nonzero Denorms
1-254 anything Norms
implicit leading 1
255 0 +/- infinity
255 nonzero NaN
Due: Nov. 17
CS 314 Chapter 3.36 CSE, 2016