Skip to content
Prev 9481 / 10988 Next

[Rcpp-devel] Rcpp ISNAN slower than C ISNAN?

On Wed, Dec 14, 2016 at 12:23 PM, Johannes Kruisselbrink
<johannes at kruisselbrink.eu> wrote:
Me either :)
Of course, the above isn't particular to Rcpp, but I found that
tracking down the underlying machinery of ISNAN in the context of Rcpp
to be an interesting and useful exercise.
[...]
Can you be more specific?
Just to clarify, R's NA is subset of ieee NaN.  So std::isnan catches
both NAs and NaNs.  If you need to manually catch *just* NAs, then it
looks like you need to return to an R-core solution (please do correct
me if I muxed this up).
Ref: https://github.com/wch/r-source/blob/trunk/src/main/arithmetic.c#L108

best,
Christian