emacs-devel
[Top][All Lists]
Advanced

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

Re: Q on NaN


From: Luc Teirlinck
Subject: Re: Q on NaN
Date: Fri, 24 Jun 2005 15:59:11 -0500 (CDT)

Drew Adams wrote:
   
   That doesn't tell me how to test if `foobar' is a NaN. See my previous
   email: I knew I could test `(equal foo 0.0e+Nan)', but I thought I would
   need to test against all of the possible NaN values.

The GNU C library has an isnan macro.  From Lisp you could do:

(defun nanp (obj)
  "Return t if OBJ is a NaN; nil otherwise,"
  (and (numberp obj) (/= obj obj)))

Sincerely,

Luc.





reply via email to

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