floating-point number - hardware or lisp dependent?



build_info();

gives the information you want. Below there are some examples.

If I am not mistaken Maxima on Windows is compiled with GCL, Ubuntu uses a
SBCL-compiled version and I believe MAC uses SBCL too.

Surprisingly CMUCL doesn't like 5e-324, 4e-324, 3e-324.

Volker

(%i1) build_info();
(%o1)
Maxima version: "5.30.0"
Maxima build date: "2013-04-03 11:04:01"
Host type: "i686-pc-linux-gnu"
Lisp implementation type: "GNU Common Lisp (GCL)"
Lisp implementation version: "GCL 2.6.7"
(%i2) [12345678.9, 123456789.12345671, 5e-324, 4e-324, 3e-324];
(%o2) [1.23456789E+7, 1.2345678912345672E+8, 5.0d-324, 4.0d-324, 3.0d-324]

(%i1) build_info();
(%o1)
Maxima version: "5.30.0"
Maxima build date: "2013-04-03 13:00:53"
Host type: "i686-pc-linux-gnu"
Lisp implementation type: "SBCL"
Lisp implementation version: "1.0.57.0.debian"
(%i2) [12345678.9, 123456789.12345671, 5e-324, 4e-324, 3e-324];
(%o2) [1.2345678900000001e+7, 1.2345678912345673e+8, 4.94065645841247e-324,
                                                                      0.0,
0.0]

(%i1) build_info();
(%o1)
Maxima version: "5.30.0"
Maxima build date: "2013-04-03 13:10:21"
Host type: "i686-pc-linux-gnu"
Lisp implementation type: "ECL"
Lisp implementation version: "11.1.1"
(%i2) [12345678.9, 123456789.12345671, 5e-324, 4e-324, 3e-324];
(%o2) [1.23456789e+7, 1.2345678912345671e+8, 4.940656458412466e-324,
                                4.940656458412466e-324,
4.940656458412466e-324]

(%i1) build_info();
(%o1)
Maxima version: "5.30.0"
Maxima build date: "2013-04-03 13:04:34"
Host type: "i686-pc-linux-gnu"
Lisp implementation type: "Clozure Common Lisp"
Lisp implementation version: "Version 1.8-r15286M  (LinuxX8632)"
(%i2) [12345678.9, 123456789.12345671, 5e-324, 4e-324, 3e-324];
(%o2) [1.23456789E+7, 1.2345678912345672E+8, 5.0E-324, 5.0E-324, 5.0E-324]


(%i1) build_info();
(%o1)
Maxima version: "5.30.0"
Maxima build date: "2013-04-03 12:58:55"
Host type: "i686-pc-linux-gnu"
Lisp implementation type: "CLISP"
Lisp implementation version: "2.49 (2010-07-07) (built 3539672548) (memory
3573975538)"
(%i2) [12345678.9, 123456789.12345671, 5e-324, 4e-324, 3e-324];
(%o2)        [1.23456789E+7, 1.2345678912345671E+8, 0.0, 0.0, 0.0]


(%i1) build_info();
(%o1)
Maxima version: "5.30.0"
Maxima build date: "2013-04-03 12:59:52"
Host type: "i686-pc-linux-gnu"
Lisp implementation type: "CMU Common Lisp"
Lisp implementation version: "Debian build debian/20c-2-1-g957a42a-dirty
(20C Unicode)"
(%i2) [12345678.9, 123456789.12345671, 5e-324, 4e-324, 3e-324];

Maxima encountered a Lisp error:

 Reader error at 8 on #<String-Input Stream>:
Floating-point number not representable

...




2013/4/4 Jorge Calvo <Jorge.Calvo at avemaria.edu>

> Hello there:
>
> A recent comment by Volker van Nek <volkervannek at gmail.com<mailto:
> volkervannek at gmail.com>> on the "scientific notation - truncation" thread
> (Message-ID: <
> CAKFbC62j2QbOcUJfrt22zhjAsSVx90jBmtOqPzVzhhLSi4adCw at mail.gmail.com<mailto:
> CAKFbC62j2QbOcUJfrt22zhjAsSVx90jBmtOqPzVzhhLSi4adCw at mail.gmail.com>>)
> reminded me of a curious issue that I discovered a few months ago while
> teaching a course in "scientific programming."  The students in the class
> run Maxima on a variety of platforms (mostly Mac and PC) and as a result,
> from time to time there are some slight differences in the answers they
> get.  For example, suppose that we enter:
>
> (%i1) 12345678.9;
> (%i2) 123456789.12345671;
> (%i3) 5e-324;
> (%i4) 4e-324;
> (%i5) 3e-324;
>
> Running on a Mac, I get:
>
> (%o1) 1.2345678900000001*10^7
> (%o2) 1.2345678912345673*10^8
> (%o3) 4.94065645841247*10^-324
> (%o4) 0.0
> (%o5) 0.0
>
> But on a Windows machine, I get:
>
> (%o1) 1.23456789*10^7
> (%o2) 1.2345678912345672*10^8
> (%o3) 4.9406564584124654*10^-324
> (%o4) 4.9406564584124654*10^-324
> (%o5) 0.0
>
> I initially assumed the difference was in the hardware implementation of
> floats, but Volker's comment makes me wonder whether the difference might
> be the underlying Lisps.  Can anyone shed some light on this?  Is there a
> way that a newbie like me can check what version of Lisp is lying under
> their Maxima?
>
> Thanks for your assistance,
>
> Jorge
> --
> Dr. Jorge Alberto Calvo
> Associate Professor of Mathematics
> Department of Mathematics and Physics
> Ave Maria University
>
> Phone: (239) 280-1608
> Email: jorge.calvo at avemaria.edu<mailto:jorge.calvo at avemaria.edu>
> Web: http://sites.google.com/site/jorgealbertocalvo
>
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>