floating-point number - hardware or lisp dependent?
Subject: floating-point number - hardware or lisp dependent?
From: Henry Baker
Date: Thu, 04 Apr 2013 17:05:45 -0700
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.