#370 Problems with IEEE-float NaN and INF

open
nobody
5
2006-09-09
2003-08-01
No

flinf: 2.0^1024$

flinf => Error: Can't print a non-number (lisp break)
Should print something special, e.g. INFe0

flnan: flinf-flinf$

flnan => Bind stack overflow (lisp break)
Should print something special, e.g. NaNe0

is(flnan=flnan) => TRUE NO! NaN is not equal to itself;
cf ?=(flnan,flnan).

is(flnan>0) => TRUE NO!
is(flnan<0) => TRUE NO!

flnan*0 => 0 NO!
flinf*0 => 0 NO!

GCL also can't print flnan/flinf.

Maxima 5.9.0 gcl 2.5.0 mingw Windows 2000 Athlon

Discussion

  • Robert Dodier

    Robert Dodier - 2005-06-26

    Logged In: YES
    user_id=501686

    In reference to the examples given in the original write-up,
    it is worth pointing out that GCL does indeed compute inf
    and nan; it just can't display them.

    Clisp refuses to compute the inf or nan, and there doesn't
    appear to be a way to compel it to do so.

    CMUCL is happy with inf and nan after :lisp
    (extensions::set-floating-point-modes :traps nil) is executed.

     
  • Robert Dodier

    Robert Dodier - 2006-07-08
    • labels: --> 460522
     
  • Robert Dodier

    Robert Dodier - 2006-07-08

    Logged In: YES
    user_id=501686

    Clisp does not recognize floating point INF and NAN; those 2
    values cannot be produced or recognized by Clisp's floating
    point implementation (which is all software for greater
    portability). So I can't see any way, short of modifying
    Clisp, for Maxima to accomodate INF and NAN in a way that is
    workable across Lisp implementations.

    We could probably convince the GCL team to modify GCL to
    handle INF and NAN; that seems a lesser challenge than
    getting Clisp modified.

     
  • Robert Dodier

    Robert Dodier - 2006-09-09
    • labels: 460522 --> Lisp Core - Floating point
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks