emacs-devel
[Top][All Lists]
Advanced

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

RE: Q on NaN


From: Drew Adams
Subject: RE: Q on NaN
Date: Fri, 24 Jun 2005 12:33:53 -0700

I said this:

    (condition-case nil (setq foo (/ 0.0 0.0)) (arith-error nil))
    In older versions of Emacs (at least prior to April 2005 CVS), 
    this would evaluate to nil. Now, it evaluates to -0.0NaN.
    I can modify the code like so:
    (and (condition-case nil (setq foo (/ 0.0 0.0)) (arith-error nil))
         (bar foo)) ; foo must be a number, not a NaN
    What function do I use for bar? 
    `numberp' doesn't work, since (numberp -0.0NaN) is non-nil. 

To make the point simpler:

(numberp (/0.0 0.0)) returns t. That seems like a bug to me.





reply via email to

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