Skip to content

Commit 702e3f3

Browse files
committed
Better motivation for current NA checking
1 parent a5b1d88 commit 702e3f3

File tree

1 file changed

+5
-7
lines changed
  • inst/include/Rcpp/internal

1 file changed

+5
-7
lines changed

inst/include/Rcpp/internal/na.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@
2323
namespace Rcpp {
2424
namespace internal {
2525

26-
// On 64bit processors, NAs can change
27-
// we can still get a performance benefit by checking for specific
28-
// bit patterns, though
26+
// we rely on the presence of unsigned long long types, since we
27+
// want to compare specific bit patterns, but we can't explicitly
28+
// assign a hex to a double storage.
2929

30-
// we rely on the presence of unsigned long long types (could do it with
31-
// a union, but that's messier; this is cleaner)
3230
#ifdef RCPP_HAS_LONG_LONG_TYPES
3331

3432
#ifdef HAS_STATIC_ASSERT
@@ -39,9 +37,9 @@ static_assert(
3937
#endif
4038

4139
// motivation: on 32bit architectures, we only see 'LargeNA'
42-
// as defined ashead; on 64bit architectures, R defaults to
40+
// as defined ahead; on 64bit architectures, R defaults to
4341
// 'SmallNA' for R_NaReal, but this can get promoted to 'LargeNA'
44-
// if a certain operation can create a 'signalling' NA.
42+
// if a certain operation can create a 'signalling' NA, e.g. NA_real_+1
4543
static const rcpp_ulong_long_type SmallNA = 0x7FF00000000007A2;
4644
static const rcpp_ulong_long_type LargeNA = 0x7FF80000000007A2;
4745

0 commit comments

Comments
 (0)