[R] colSums in C

Thomas Lumley tlumley at u.washington.edu
Wed Dec 19 01:35:44 CET 2001


On Tue, 18 Dec 2001, David Brahm wrote:
>
> Is there a macro that is equivalent to (as fast as) isnan() when it exists?
> ISNAN is definitely slower.
>

You should be able to test for NA or NaN pretty efficiently with
    x!=x
This doesn't work on systems without IEEE754 arithmetic, but more
importantly some compilers don't realise that it's a real test and
optimise it away.


	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list