How does 0x12.2P2
equal 72.5?
I know that the value following the P, called the binary exponent, indicates the power-of-two by which the number is multiplied?
How does 0x12.2P2
equal 72.5?
I know that the value following the P, called the binary exponent, indicates the power-of-two by which the number is multiplied?
0x12.2P2
is 0x122 / 1610 * 22
More formally (?), for the part before the P
, you can use this very classic conversion table:
decimal point here ▼
+-----+-----+-----+-----+-+-----+-----+-----+
| 16³ | 16² | 16¹ | 16⁰ | | 16⁻¹| 16⁻²| 16⁻³|
+-----------------------------------------+
| | | 1 | 2 |.| 2 | | |
+-----+-----+-----+-----+-+-----+-----+-----+
So 0x12.2 is 1⨯16¹+2x16⁰+2⨯16⁻¹ = 18.125