Professional Documents
Culture Documents
• Scientific notation:
− 1.602 −19
The IEEE Standard
���� � �� � × ����
10 ����
sign significand base exponent
MIT 18.335J / 6.337J
1 2
• The gaps between adjacent numbers scale with the size of the numbers • ±∞ is returned when an operation overflows
• Relative resolution given by machine epsilon, ǫmachine = .5β 1−p • x/ ± ∞ = 0 for any number x, x/0 = ±∞ for any nonzero number x
• For all x, there exists a floating point x′ such that |x − x′ | ≤ ǫmachine |x| • Operations with infinity are defined as limits, e.g.
• Example: β = 2, p = 3, emin = −1, emax = 2 4 − ∞ = lim 4 − x = −∞
x→∞
3 4
• With normalized significand there is a “gap” between 0 and β emin • 1 sign bit, 8 exponent bits, 23 significand bits:
• This can result in x − y = 0 even though x �= y , and code fragments like 0 00000000 0000000000000000000000000000000
• Solution: Allow non-normalized significand when the exponent is emin • Represented number:
• This gradual underflow garantees that
5 6
IEEE Single Precision, Examples IEEE Floating Point Data Types
7 8
For all floating point x, y , there exists ǫ with |ǫ| ≤ ǫmachine such that
x ⊛ y = (x ∗ y)(1 + ǫ)
• Round to nearest even in the case of ties
9
MIT OpenCourseWare
http://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.