From: Sam S. <sd...@gn...> - 2002-08-28 16:30:56
|
> * In message <4nu...@rt...> > * On the subject of "Re: expt bug" > * Sent on 28 Aug 2002 12:17:00 -0400 > * Honorable Raymond Toy <to...@rt...> writes: > > >>>>> "Bruno" == Bruno Haible <ha...@il...> writes: > > Bruno> Raymond Toy writes: > >> > In 2.28 and 2.29 on Solaris I get: > >> > > >> > [1]> (expt -5.0 2.0) > >> > #C(25.000002 4.3711393E-6) > >> > [2]> (expt -5.0d0 2.0d0) > >> > #C(24.999999999999996d0 -6.122503540205582d-15) > >> > > >> > Somewhat surprising results since the correct answers are real > >> > numbers. > > Bruno> Raymond, you know what a floating-point number stands for: an interval > Bruno> of real numbers. 2.0 stands for the interval [2 - eps, 2 + 2*eps], > Bruno> where eps is single-float-negative-epsilon. > > We've had these discussions before and I think this is were we've > always disagreed. You want to treat all FP numbers as intervals. I > want to treat them as exact rationals. this is wrong, even thought it might look good. if floats were exact rationals, then the product of two single floats would have been a double float. the issue here is accuracy vs precision, see <http://clisp.cons.org/impnotes.html#flocont> -- Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux <http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/> <http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html> Of course, I haven't tried it. But it will work. - Isaak Asimov |