Tue 01 Oct 2013 03:38:16 AM UTC, original submission:
GCL 2.6.9 ANSI on Linux incorrectly parses floating point literals 1e-6 and 1e-7 incorrectly, but only in compiled code; interpreted code is OK. Similar literals (see example program below) are parsed correctly.
Example:
-------- begin foo.lisp ---------
(defvar foo
'(-2e9 -2e8 -2e7 -2e6 -2e5 -2e4 -2e3 -2e2 -2e1 -2e0 -2e-1 -2e-2 -2e-3 -2e-4 -2e-5 -2e-6 -2e-7 -2e-8 -2e-9
-1e9 -1e8 -1e7 -1e6 -1e5 -1e4 -1e3 -1e2 -1e1 -1e0 -1e-1 -1e-2 -1e-3 -1e-4 -1e-5 -1e-6 -1e-7 -1e-8 -1e-9
1e9 1e8 1e7 1e6 1e5 1e4 1e3 1e2 1e1 1e0 1e-1 1e-2 1e-3 1e-4 1e-5 1e-6 1e-7 1e-8 1e-9
2e9 2e8 2e7 2e6 2e5 2e4 2e3 2e2 2e1 2e0 2e-1 2e-2 2e-3 2e-4 2e-5 2e-6 2e-7 2e-8 2e-9))
--------- end foo.lisp -----------
Session:
$ gcl
GCL (GNU Common Lisp) 2.6.9 ANSI Sep 1 2013 17:56:48
Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl)
Binary License: GPL due to GPL'ed components: (XGCL UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter
Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files set to /tmp/
>(compile-file "/home/robert/tmp/foo.lisp")
Compiling /home/robert/tmp/foo.lisp.
End of Pass 1.
End of Pass 2.
OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3
Finished compiling /home/robert/tmp/foo.lisp.
#p"/home/robert/tmp/foo.o"
>(load *)
Loading /home/robert/tmp/foo.o
start address -T 0x98f388 Finished loading /home/robert/tmp/foo.o
87
>(mapcar #'(lambda (x) (eq x 0.0)) foo)
(NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL
NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL
NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL
NIL NIL NIL NIL T T NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL
NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL)
>
|