R_xlen_t is an integer type

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

R_xlen_t is an integer type

R devel mailing list
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.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel