Skip to content

a strange logical bug (PR#162)

3 messages · Brian Ripley, Peter Dalgaard, Nicholas Lee

#
On RH 5.2

       The isnan() function returns a non-zero value if value  is
       "not-a-number" (NaN), and 0 otherwise.

and that non-zero is not defined!

On Solaris:

     isnan(), isnand(), and isnanf() return true (1) if the argu-
     ment dsrc or fsrc is a NaN; otherwise they return false (0).

and isnan is used in Arith.c for ISNAN and that is used in coerce.c
for do_isna (why?)

So ISNAN needs to be redefined on Linux at least.  Using ISNA not ISNAN
solves this one for me.

Brian
#
ripley@stats.ox.ac.uk writes:
Uh-oh...
is.na(0/0) # Splus compat.
But...(see above)

A better fix is 

#define ISNAN(x) (isnan(x)!=0)

Next problem: Messing with Arith.h and make'ing doesn't do anything
(dependency missing, obviously)
#
On Fri, 9 Apr 1999 ripley@stats.ox.ac.uk wrote:

            
I don't seem to have this problem on Debian 2.2 (with glibc2.1):
[1] 1
[1] 1 1 0


Nicholas


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._