Skip to content
Prev 5881 / 398506 Next

NA in C/C++

Prof Brian D Ripley <ripley at stats.ox.ac.uk> writes:
...
Perhaps it is necessary to be a little more specific here: The IEEE
NaN is not a single value, but a set of values characterized by having
an all-ones exponent and a non-zero significand (the cases with a zero
significand are +Inf and -Inf). Have a look at

http://www.linuxsupportline.com/~billm/index.html

for the details.

The double NA in R on IEEE-supporting systems is the NaN with
significand 1954 (no, I don't know who was born that year...). 

However integers have no definition of NaN, so NaInt is INT_MIN and
for systems that don't support IEEE, we have some special hacks too.
Have a look in src/include/R_ext/Arith.h and src/main/arithmetic.c.