Skip to content

Commit 8a60ab7

Browse files
committed
Fix for Rcpp_IsNaN, given BDR's advice on R-devel
1 parent 4a86ba6 commit 8a60ab7

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

inst/include/Rcpp/NAComparator.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,14 @@ namespace Rcpp{
2727

2828
inline bool Rcpp_IsNA(double x) {
2929
return memcmp(
30-
&x,
31-
&NA_REAL,
30+
(void*) &x,
31+
(void*) &NA_REAL,
3232
sizeof(double)
3333
) == 0;
3434
}
3535

3636
inline bool Rcpp_IsNaN(double x) {
37-
return memcmp(
38-
&x,
39-
&R_NaN,
40-
sizeof(double)
41-
) == 0;
37+
return R_IsNaN(x);
4238
}
4339

4440
inline int StrCmp(SEXP x, SEXP y) {

0 commit comments

Comments
 (0)