gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: Possible bug in print of small floats?


From: Camm Maguire
Subject: [Gcl-devel] Re: Possible bug in print of small floats?
Date: 30 May 2005 17:38:47 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!

Right now, GCL just passes forward the standard IEEE floating point
conventions, which, to my knowledge, conforms with the ANSI spec.
Apart from the normal floating point numbers, there are also
denormalized numbers, which GCL decodes correctly, NaN, and Inf.  Your
coercsion makes an inf, overflowing the MOST-POSITIVE-SHORT-FLOAT
on x86 of 3.402823S38. GCL doesn't print these, as it cannot read them
meaningfully. I suppose it could, but then we'd have to add concepts
like negative zero, etc.  There may be a gcc compiler switch we can
set to signal a trapable floating point exception when such items are
produced -- this is not the default IEEE behavior, but may be
desirable in lisp.

Richard Fateman has expressed in the past the desirability of pushing
these values forward into lisp, if I recall correctly.  If memory
serves, the discussion thus started yielded no consensus on what would
be most acceptable to all users.

Take care, 

Robert Boyer <address@hidden> writes:

> Or is the bug perhaps in coerce, for not producing an error when producing a
> nonnumber?  Transcript below.
> 
> Bob
> 
> -------------------------------------------------------------------------------
> GCL (GNU Common Lisp)  2.6.6 CLtL1    May 27 2005 16:28:17
> 
> >(setq x (coerce 1111111111111111111111111111111111111111111 (type-of .1s2)) 
> >bar nil)
> 
> NIL
> 
> >(type-of x)
> 
> SHORT-FLOAT
> 
> >(integer-decode-float x)
> 
> 8388608
> 105
> 1
> 
> >x
> 
> 
> Error: Can't print a non-number.
> t
> t
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]