We all know that there are values in decimal that don't have an exact representation in binary.
For example the decimal value 0.1
.
In IEEE floating point format it can have different representations depending on how many bits you want to dedicate to representing a floating-point value.
Single Precision (32-bits)
- Hex: 0x3DCCCCCD
- Binary: 1.10011001100110011001101×10-4
- Decimal: 0.10000 00014 90116 11938 47656 25
Double Precision (64-bits)
- Hex: 0x3FB999999999999A
- Binary: 1.1001100110011001100110011001100110011001100110011010×10-4
- Decimal: 0.10000 00000 00000 00555 11151 23125 78270 21181 58340 45410 15625
Extended Precision (80-bits)
- Hex: 0x3FFBCCCCCCCCCCCCCCCD
- Binary: 1.100110011001100110011001100110011001100110011001100110011001101×10-4
- Decimal: 0.10000 00000 00000 00000 13552 52715 60688 05425 09316 00108 74271 39282 22656 25
In other words, the decimal value 0.1
does not have an exact representation in binary, it is endlessly repeating value:
0.0 0011 0011 0011 0011 0011 0011 0011 0011 ...
0.0 ̅0̅0̅1̅1
In the same way 1⁄3 has no exact representation in decimal - its digits after "decimal point" keep repeating forever:
0.33333 33333 33333 33333 33333 33333 33333 ...
0.̅3
But does it go the other way?
Are there any values in binary that don't have an exact representation in decimal?
Why am I asking? To extend the bounds of understanding, and add to the sum of human knowledge.
Edit: I don't know why someone is voting to close as a duplicate when the linked question is literally the exact opposite of mine.