On Tue, 9 Jan 2007 at 08:43:15 +1100, Luke Hope wrote:
> On 1/9/07, Alex Mizrahi <killerstorm@...> wrote:
> > Hello, All!
> > (/ 0 0.0d0) => #<double-float NaN>
> > ok, i'd like to check if number is NaN or not. i didn't find such function
> > in ANSI CL and in ABCL's ext package. is there such function?
> > i came up with such:
> > (defun isNAN (n)
> > (not (or (< n 0.0d0) (> n 0.0d0))))
> CL-USER(4): (isnan 0.0d0) ;; ooops!
> CL-USER(5): (defun isNAN (n)
> (not (or (< n 0.0d0) (>= n 0.0d0))))
> CL-USER(6): (isnan (/ 0 0.0d0))
> CL-USER(7): (isnan 0.0d0)
What you're looking for is SYS:FLOAT-NAN-P.