When 0.2 is not exactly 0.2
On one machine, the C constant `0.2` has the effective value `0.2000000000000000111`. Consequently, `0.2` and `0.2000000000000000111` can represent the same floating-point value. section 5.3
TAKEAWAY: The effective value of a decimal floating-point constant may differ from its literal value. Binary fractional digits cannot always represent the written decimal exactly, so the implementation truncates or rounds them. section 5.3
Hexadecimal floating-point constants more closely describe binary representations; on most modern architectures, constants with few enough digits correspond exactly to their literal values. section 5.3
| double |
long double |
||
|---|---|---|---|
| literal | 0.2F | 0.2 | 0.2L |
| value | 0x1.99999AP-3F | 0x1.999999999999AP-3 | 0xC.CCCCCCCCCCCCCCDP-6L |
Compare decimal, hexadecimal, `float`, `double`, and `long double` spellings for the value commonly written as `0.2`. section 5.3

