Floating point printing bug(s)

John Carroll <[email protected]> Wed, 10 Jul 2002 12:48:16 +0100
Newsgroups gmane.lisp.openmcl.bugs
Message-ID <[email protected]>
I'm printing out lots of floats and occasionally get incorrect or very
strange looking numbers in the output, e.g.

? (coerce 1.4470288761911116D-4 'single-float)
1.0E-4
? (format t "~,6G" *)
>.470290E-5
NIL

I think the problem is with the printer because the single float appears
to behave normally wrt arithmetic operations:

? (coerce 1.4470288761911116D-4 'single-float)
1.0E-4
? (* * 2)
2.8940578E-4

Another strange printout:

? (format t "~,10G" 1.3648871727442815D-4)
0.=648871727D-4
NIL

And two more (I've only seen = > and : inserted in the numbers output):

? (coerce 9.979289D-6 'single-float)
9.979289E-6
? (format t "~,6G" *)
:.000000E-6
NIL

? (coerce 1.3648871727442815D-4 'single-float)
1.0E-4
? (format t "~,6G" *)
=.648870E-5
NIL

This is with OpenMCL Version (Beta: Darwin) 0.12.1

John Carroll

-- 
Cognitive and Computing Sciences,   E-Mail: [email protected]
University of Sussex,               Tel: (+44 / 0)1273 678029
Falmer, Brighton BN1 9QH, UK        Fax: (+44 / 0)1273 671320