-
-
Notifications
You must be signed in to change notification settings - Fork 219
Closed
Description
It may have something to do with #465, which was unresolved back in 2016:
Rcpp::cppFunction("bool comp(Function fun) { return runif(1)[0] > as<double>(fun()); }")
set.seed(1)
sum(replicate(1e3, comp(function() runif(1, 0, 1))))
# 0
sum(replicate(1e3, comp(function() runif(1, 0.0001, 0.9999))))
# 481
This is very odd. I'm not sure what's happening here. I've spent hours debugging a package of mine due to a very strange behaviour that has to do with this, but I finally managed to get this simple example that only involves Rcpp. I don't have much energy left today to investigate further. Any help would be appreciated.
Metadata
Metadata
Assignees
Labels
No labels