On 3/23/2011 6:42 AM, Esben Byskov wrote:
(objecting to round-off in 29.40000000000001)
Note that 1/10 cannot be represented exactly in a finite binary expansion.
If we carry more digits and convert 0.1 as a single-precision float into
decimal, it look like approximately
.1000000000000000055511151231257827021182....
(and 1/5, which is twice that, also cannot be represented exactly)
You may argue that the display should have rounded the number so that
29.400000000...1 comes up 29.4, but then, how did you know that the
intended answer wasn't 29.40000...1? You could get that same number
by adding 294/10 + 1/10....0, in which case you might object
(correctly) that
Maxima was displaying the result accurately.
There is another way around this, sometimes used, which is to do all
arithmetic in decimal. But some numbers cannot be represented exactly
in a finite decimal expansion. Like 1/3. So the improvement is
an illusion.
*
**
*