strange behaviour with simple decimals



 

> -----Original Message-----
> From: maxima-bounces at math.utexas.edu 
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Jay Belanger
> > Interesting.  I realize that calculators typically only give
> approximations, but when does it give the wrong answer when you'd
> expect the right one?  (I have no doubt such cases exist; I just don't
> know one offhand.)

Examples can be concocted by
 computing a number that is not representable in decimal float, like 1/3.

Try 3*(1/3)-1  .  Now some calculators will carry enough extra precision (2
extra digits)
so that you will need to be a little bit more devious.  

A very thorough and amusing article concerning arithmetic, computer and
calculator, is
Kahan's Mathematics Written in Sand

http://www.cs.berkeley.edu/~wkahan/MathSand.pdf