waldo
waldo copied to clipboard
include is.nan()-comparison in num_equal() + test
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_
.