strange behaviour with simple decimals



This isn't a bug.

In Maxima, the number 1.4 is a IEEE double float. The decimal
representation of 14/10 terminates, but its binary representation
endlessly repeats. To fit into memory, the binary representation
of 14/10 must be truncated. So 14/10 is close to, but not equal to,
the nearest IEEE double float to 14/10. For details, I recommend:

http://portal.acm.org/citation.cfm?id=103163&jmp=cit&coll=GUIDE&dl=ACM&CFID=11111111&CFTOKEN=2222222


The Maxima function 'rationalize' does an exact float to rational
conversion:

(%i1) rationalize(0.1);
(%o1) 3602879701896397/36028797018963968

Barton

-----maxima-bounces at math.utexas.edu wrote: -----


>  (%i1) 3*1.4^2;
>  (%o1)                          5.879999999999999