strange behaviour with simple decimals



On Wed, 11 Apr 2007, Jay Belanger wrote:
> The issue, as I see it, isn't about understanding floating point
> arithmetic, it about what's good enough for Maxima.  If Maxima adheres
> to standards which allow 3*1.4^2 to not quite be 5.88, in other words
> if Maxima can't quite correctly do fifth grade arithmetic, is that good
> enough?
I *strongly* disagree.

If you want an exact calculation, do it in rationals:
3*(14/10)^2;
will give you an exact result.

If you use a floating-point number 1.4, it cannot be represented by a 
finite-length binary, and operations on it will produce approximate 
results due to rounding errors.

I think it would be *extremely* stupid (though possible, of course) to use 
decimal arithmetics in a CAS. Why base 10? Why not 12? Or 16? Or anything 
else? 10 does not stand out in any way (2 does).

Andrey