A very small error in float?



-----maxima-bounces at math.utexas.edu wrote: -----
?
>????On?3/23/2011?6:42?AM,?Esben?Byskov?wrote:
>????(objecting?to?round-off?in?29.40000000000001)

One more thing: The function rationalize converts a floating point number to 
its exact rational value; for example

 (%i1)  rationalize(29.4);
 (%o1) 4137682157646643/140737488355328

Thus the binary64 number 29.4 does not equal 735/25:

 (%i3) is(equal(735/25, rationalize(29.4)));
 (%o3) false

Finally, the binary64 number 10.0 does equal 10:

 (%i6) is(equal(10, rationalize(10.0)));
 (%o6) true

--Barton