adding floats. a peculiarity, and a proposal



in 5.9.3, xmaxima

(%i8) sum(0.1d0,i,1,1000);
(%o8) 			       99.99999999999859
(%i9) sum(0.1d0,i,1,1000000);
(%o9) 			       100000.0000013329

It's like that old joke "we lose a little on each sale, but we make it up on
the volume..."

I have (yet another) proposal for floats for people to think
about, courtesy of W. Kahan..

In one sentence:

 ALL user floating-point format input be stored as infinitely precise
rational numbers until
there is a first conversion to something that is used computationally, at
which point it is
converted to the appropriate type, precision, etc.



(%i13) 0.1*10^n-10^(n-1);
                                     n     n - 1
(%o13) 			       0.1 10  - 10
(%i14) factor(%);
`rat' replaced 0.1 by 1//10 = 0.1
(%o14) 				       0
(%i15)