Академический Документы
Профессиональный Документы
Культура Документы
Representation
Binary
IEEE
754 standard
Beware
Finite
Scientific notation
Decimal:
Three pieces:
Format:
sign
exponent
significand
sign
exponent
significand
23
Normalized
1negative, 0non-negative
Significand:
Exponent:
Example: 0.75
0.75 ten = 0.11 two = 1.1 x 2 -1
1.1 = 1. F F = 1
E 127 = -1 E = 127 -1 = 126 = 01111110two
S=0
10
00111111010000000000000000000000 =
Comp Sci 251 -- Float
0x3F400000
-4 = E 127
11
00111101110011001100110011001100110011
11
52
Special-case numbers
Problem:
Solution:
13
E = 000
E = 111
Comp Sci 251 -- Float
Special-case numbers
Zeroes:
0
000
000
000
000
111
000
111
000
+0
-0
Infinities:
14
+
-
Comp Sci 251 -- Float
Denormalized numbers
No hidden 1
Allows numbers very close to 0
E = 000 Different interpretation applies
Denormalization rule: number represented is
(-1)S0.F2-126 (single-precision)
(-1)S0.F2-1022 (double-precision)
15
= 000, F = 000 0
E = 000, F 000 denormalized
0000
E
= 111
F = 000 infinities
F 000 NaN
16