Is there any implementation of functionality in R, such that it is possible to get the next representable floating point number from a given floating point number. This woul
If you prefer Rcpp:
#include using namespace Rcpp; // [[Rcpp::export]] double nextAfter(double x, double y) { return nextafter(x, y); }
Then in R:
sprintf("%.20f", 1) #[1] "1.00000000000000000000" sprintf("%.20f", nextAfter(1, 2)) #[1] "1.00000000000000022204"