[Rd] R_xlen_t is an integer type

Suharto Anggono Suharto Anggono suharto_anggono at yahoo.com
Sun Aug 27 14:10:05 CEST 2017


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.



More information about the R-devel mailing list