-
Notifications
You must be signed in to change notification settings - Fork 339
Closed
Description
CRAN recently started testing packages on machines where long double aren't available. This can cause broken tests that require many package developers to spend time scouring the internet for a solution.
There's a nice overview of the issues and solution here: https://blog.r-hub.io/2019/05/21/nold
It seems that many problems would disappear with a small change to testthat::compare().
Currently in the signature to testthat:::compare.numeric, tolerance defaults to .Machine$double.eps^0.5.
I think a better default is .Machine$double.eps ^ if(capabilities("long.double")) 0.5 else 0.25.
If silently increasing the tolerance worries you, it could be done with a message.
get_default_tolerance <- function() {
pwr <- if(capabilities("long.double")) {
0.5
} else {
message("Long doubles are not available, so tolerance is increased.")
0.25
}
.Machine$double.eps ^ pwr
}Then the argument default would be tolerance = get_default_tolerance().
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels