Representation of floats



(%i1) rationalize(0.2)-1/5;
(%o1) 1/90071992547409920

(%i2) float(%);
(%o2) 1.1102230246251566*10^-17

--Barton

________________________________________
From: maxima-bounces at math.utexas.edu [maxima-bounces at math.utexas.edu] on behalf of Evgeniy Maevskiy [emaevskiy at e-math.ru]
Sent: Thursday, May 17, 2012 12:23
To: maxima at math.utexas.edu
Subject: Re: [Maxima] Representation of floats

Thanks to all. Yes, it is the fact:

numer:false$
is(0.2=1/5);  /* false - it's clear */

numer:true$
is(0.2=1/5); /* true - and it's clear too */

Now I'd like to compute the error:

numer:false$
0.2-1/5;

returns 0.0

I think that the error must be about 1e-16. Can I compute it explicitly?




_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima