2014-10-28 10:32 GMT+01:00 Martin Maechler <maech...@stat.math.ethz.ch>:
> Given all this, the r-help and stackoverflow threads, > maybe we should decide that such an is.whole() function should > be added to R and maintained (by me for the time), so we do have > a better place to point people to, and well documented -- and > eventually "optimized" -- behavior ? > > Personally I do think I'd want a "signature" of > function (x, tolerance = sqrt(.Machine$double.eps)) I've written some C code which in my opinion would be a good starting point for an optimized version. The exported function in the checkmate package is called "isIntegerish" and tests an SEXP to be "safely convertible" to an INTSXP. You can find it here: <https://github.com/mllg/checkmate/blob/master/src/is_integerish.c>. Best, Michel ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel