Unformatted text preview: per number • x = (1+f)2^e – f is the fracJonal part of 1+f, stored using base 2 rep. • called the the “fracJon” or manJssa • 0 <= f < 1, 52 bits allocated for f => – 0 <= 2^52*f < 2^52 – e is an integer exponent, stored using base 2 rep. • 11 bits allocated for e, allows for  1022 <= e < 1024 – s is the sign of x (just assume x is posiJve, and apply s at the end) • s= 1, or s=1, 1 bit allocated 7 2/20/14 “IEEE 754” • x = (1+f)2^e – f is the fracJonal part of 1+f, base 2 rep. – e is an integer exponent Note: f 52 bits, base 2 rep means only certain values are possible for f • Some Examples: What are f and e – for x = 2? • 1x2^1 ó༏ f = 0, e = 1 – for x = 3? • 1.5x2^1 ó༏ f = .5, e = 1 Answer Time x = (1+f)2^e – f is the fracJonal part of 1+f, base 2 rep. – e is an integer exponent What are f and e for x=5 and x=8? – for x = 5 • 1.25x2^2 ó༏ f = .25, e = 2 – for x = 8 • 1x2^3 ó༏ f = 0, e = 3 eps • x = (1+f)2^e • For x = 2, what is the next largest ﬂoaJng point number? x = (1.0)*2^1 => (1+2^ 52)*2^1 = (1 + eps)*2^1 = x + eps*2^1 = 2 + eps*2^1 = 2 + 2*eps is next largest ﬂoaJng point number Quiz Time x = (1+f)2^e – f is the fracJonal part of 1+f, base 2 rep.
– e is an integer exponent What are f and e for x=5 and x=8? A) f=.5, e=0 and f=2, e=2 B) f=.25, e=2 and f=.5, e=4 C) f=.25, e=2 and f=0, e=3 D) None of the above eps • x = (1+f)2^e • For x = 1, what is next largest ﬂoaJng point number? x = (1.0)*2^0 => (1+2^ 52)*2^0 = 1 + (2^ 52) = 1 + eps! is next ﬂoaJng point number • Why 2^ 52? • 2^ 52 is referred to as “machine epsilon” – It is the diﬀerence between 1 and the next largest ﬂoaJng number that can be represented – It is available as eps in matlab eps • x = (1+f)2^e • For x = 3, what is the next...
View
Full
Document
 Spring '14
 Potter

Click to edit the document details