Float 1 bit sign, 11 bit exponent, 10 bit significand
Bias 2^(11-1) - 1 = 1024 - 1 = 1023
Convert the value 912.730 to float.
Integer 912
check
912 1 1 1 0 0 1 0 0 0 0
456 0 1 2
228 0 3 6
114 0 7 14
57 0 14 28
28 1 28 56
14 0 57 114
7 0 114 228
3 1 228 456
1 1 456 912
0 1 912
10 digits
Decimal .730
. .730
1 .460 1 * .5 .5
0 .920 0 * .25 .5
1 .840 1 * .125 .625
1 .680 1 * .0625 .6875
1 .360 1 * .03125 .71875
0 .720 0 * .015625
We can only store 10 digits so we should have plenty.
So, 912.730 ~ 1110010000.101110 b
Scientific 1. 1100100001 01110 * 2^9
Bias 1023 + exponent 9 = 1032
1032 1 0 0 0 0 0 0 1 0 0 0
516 0 1 2
258 0 2 4
129 0 4 8
64 1 8 16
32 0 16 32
16 0 32 64
8 0 64 128
4 0 129 258
2 0 258 516
1 0 516 1032
0 1 1032
Float sign + = 0
sign biased exponent significand
0 100 0000 1000 1100 1000 01
If you look, you can see that we only preserved 1 digit to the right of the
original real value, so the stored value is :
912.5