waldo icon indicating copy to clipboard operation
waldo copied to clipboard

include is.nan()-comparison in num_equal() + test

Open sorhawell opened this issue 2 years ago • 0 comments

Accordingly to ?is.na comparing NA_real_ and NaN is not exactly straight forward. It is stated future CPU-architectures may confound NA_real_ and NaN.

Accordingly to ?is.nan identical() or equality should not be used to check for NaN

Proposed solution is to test if is.nan(NA_real_) == is.nan(NaN) ... and as long as this base function can tell the difference, so there is a difference.

Making waldo more strict, will likely require some R packages using testthat to update some tests.

My personal angle on this problem is I use testthat to verify my interface between Rust and R. I test if my mappings are isotone(reversible) in respect to NaN and NA_real_.

sorhawell avatar Aug 30 '22 07:08 sorhawell