[R] noncommutative addition: NA+NaN != NaN+NA

Robin Hankin rksh at soc.soton.ac.uk
Tue Sep 7 12:29:51 CEST 2004


Dear Professor Ripley

thank you for your reply.

>
>>  >  NaN +NA
>>  [1] NaN
>>  >  NA + NaN
>>  [1] NA
>>
>>  I thought "+" was commutative by definition.   What's going on?
>
>It is clearly not under your compiler/OS.  We could add a configure test
>for broken systems and fix it in arithmetic.c but it hardly seems
>worthwhile.

[snip]

>  > (Both give NA under linux, so it looks like a version-specific issue).
>
>Linux on that hardware?  It might be a chip issue.


Sorry, that should read "Both give NA under linux on an i686 system, 
RedHat Linux 2.4.18"

In any event, "+" appears to be associative (which is what I was 
interested in).

best wishes

rksh


-- 
Robin Hankin
Uncertainty Analyst
Southampton Oceanography Centre
SO14 3ZH
tel +44(0)23-8059-7743
initialDOTsurname at soc.soton.ac.uk (edit in obvious way; spam precaution)




More information about the R-help mailing list