floating-point number - hardware or lisp dependent?
Subject: floating-point number - hardware or lisp dependent?
From: J M
Date: Fri, 5 Apr 2013 15:29:14 -0700
Quite some time ago I read an article on this:
How to *Read Floating Point* Numbers
Accurately<http://www.cesura17.net/%7Ewill/Professional/Research/Papers/howtoread.pdf>
www.cesura17.net/~will/Professional/Research/Papers/howto*read*.pdfI
believe this article has a scheme implementation that can write out
any floating point value in a human friendly format that can be read back
in with the exact same equal value.
On Thu, Apr 4, 2013 at 5:05 PM, Henry Baker <hbaker1 at pipeline.com> wrote:
> Guy Steele of the Common Lisp standardization committee went to a lot of
> trouble to try to assure users of Common Lisp that
>
> (read (print x)) == x, (that read was a left inverse of print).
>
> i.e., that _all numbers_, including *** floating point numbers ***, would
> be *** bit-for-bit identical *** after reading the printed value (assuming
> that you didn't force Lisp to use fewer than its preferred number of
> digits).
>
> I can't point you to the particular paragraph in the CL standard, but I
> don't think that a Common Lisp is conforming if it can't achive this goal.
>
> As a result, I would imagine that some (many?) Common Lisps may be better
> at floating point input/output than Maxima is.
>
> At 12:59 PM 4/4/2013, Stavros Macrakis wrote:
> >My guess is that the numbers are reading correctly, but not being
> correctly rounded when printed. Even the same Lisp might be using
> different numerical libraries on different platforms.
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>