<aside> 💡 Will take precedence over longs, and ints.
</aside>
$$ (-1)^sM 2^e $$
<aside> 💡 Guide: Converting to Floating Point Numbers
Denary to Float: 4.75 (8bit representation)
4 | 0 |
---|---|
2 | 0 |
1 | 1 |
- | - |
0100 - 4
.75 | 1.5 | 1 |
---|---|---|
.5 | 1 | 1 |
- | - | - |
0011
Add the exponent Part
$100.0011*2^0$
Normalize the Mantissa $1.000011*2^2$
Calculate the Exponent with $bias = 2^{k-1}-1$$E = exponent+bias$ $E = 2+3 = 5$ in binary that is 101
Represent Exponent 101
Represent Mantissa we take the 0011 (rest of the 1 area)
Represent Sign Bit negative so -1
1 | 101 | 0011 |
---|
Reversing the Floating Point Encoding - doing the backwards operation
Exponent Bits = 3, thus the bias is 3
E = exp + bias 5 = exp + 3 = EXP = 2
1.0011 * 2^2 100.11 = 2^0 4.75
</aside>