4 ms·
Floats are designed to be computationally and mathematically efficient approximations of the real numbers. The exist so that trigonometry and logarithms work p
by otabdeveloper4 4y ago
Floats are designed to be computationally and mathematically efficient approximations of the real numbers.
The exist so that trigonometry and logarithms work properly in numerical methods. (A vastly more important problem than getting '0.1' to print pretty on the screen.)
There is no such thing as a 'value' in mathematics, and fixating on 0.1 in particular is pointless.
tldr - everyone should learn the math behind this first.