3 ms·
If you want that you should use integers. This seems to be a misalignment of expectations rather than a fault in the language. Other people have posted other e
by dullcrisp 4y ago
If you want that you should use integers. This seems to be a misalignment of expectations rather than a fault in the language.
Other people have posted other examples but it’s not possible to represent real numbers losslessly in finite space. Mathematicians use symbolic computation but that probably is not what you would want for numerics. I could see a language interpreting decimal input as a decimal value and forcing you to convert it to floating point explicitly just to be true to the textual representation of the number, but it would just be annoying to anyone who wants to use the language for real computation and people who don’t understand floating point would probably still complain.
Edit: I’ll admit I have a pet peeve that people aren’t taught in school that decimal notation is a syntactic convenience and not an inherent property of numbers.