4 ms·
Technically, that's true, but the more interesting question is "How do languages handle non-integers?" Quite a few languages (like Lisp) have a rational data t
by ced 16y ago
Technically, that's true, but the more interesting question is "How do languages handle non-integers?"
Quite a few languages (like Lisp) have a rational data type, such that 1/3 + 1/4 is done exactly. Others have a decimal data type, whose main purpose is for calculations involving money. 0.1 + 0.2 = 0.3
And finally, I'm no expert on Mathematica, but IIRC it computes error bounds on your results, and it only displays decimal digits if they are within those bounds. It's the proper way of doing things, and again, 0.1 + 0.2 = 0.3