A recent R devel NEWS item: approx(), spline(), splinefun() and approxfun() also work for long vectors. In current R devel, in function 'approx1' in src/library/stats/src/approx.c and in function 'spline_eval' in src/library/stats/splines.c, in #ifdef LONG_VECTOR_SUPPORT there is a comment "R_xlen_t is double". It is incorrect. In Rinternals.h, in #ifdef LONG_VECTOR_SUPPORT R_xlen_t is defined as ptrdiff_t , an integer type. In function 'approx1' in src/library/stats/src/approx.c, R_xlen_t ij = (i+j) / 2; can be used unconditionally. In function 'spline_eval' in src/library/stats/src/splines.c, R_xlen_t k = (i+j) / 2; can be used unconditionally.
R_xlen_t is an integer type
1 message · Suharto Anggono Suharto Anggono