Page 1 of 1

-nan is not number

Posted: Mon Aug 01, 2016 8:56 am
by ssqq
-nan (NaN) should not return true with number?

Code: Select all

> (set 'nan (sqrt -1))
> (number? nan)
true ;; should return nil
Also advise with inf. I think all NaN and Inf are "error status" that may not throw error immediatly.
So they isn't value.

Re: -nan is not number

Posted: Tue Aug 02, 2016 10:03 am
by TedWalther
ssqq wrote:-nan (NaN) should not return true with number?

Code: Select all

> (set 'nan (sqrt -1))
> (number? nan)
true ;; should return nil
Also advise with inf. I think all NaN and Inf are "error status" that may not throw error immediatly.
So they isn't value.
Reliably getting nan and inf from the C compiler is not pleasant. It varies between compilers and architectures and platforms. The alternative is to write assembly language... which would really require some paid resources to keep track of all the different types of CPU.

Re: -nan is not number

Posted: Tue Aug 02, 2016 12:22 pm
by rickyboy
Hello ssqq,

This is what you need: http://www.newlisp.org/downloads/newlis ... .html#NaNp.

As a backgrounder, the committee who put together the floating point standard had a reason for admitting things like NaN as floating point "values". Technically they are "numbers" (FP values, really).

http://grouper.ieee.org/groups/754/faq.html#exceptions

Re: -nan is not number

Posted: Tue Aug 02, 2016 2:40 pm
by ssqq
I see, Reason is ANSI C could not support.

Re: -nan is not number

Posted: Thu Dec 22, 2022 2:46 am
by services
However, there are a great number of issues that arise in the minds of customers while they are in the process of hiring escorts.Pattaya Beach escort sites Regarding these questions, we have provided further information.