Skip to content
Prev 62812 / 63421 Next

64bit integers

On 25/01/2025 23:37, Simon Urbanek wrote:
Both Luke and I have looked into 64-bit integers, and not yet found them 
a high enough priority.

Perhaps the most compelling motivation has not yet been mentioned. Array 
dimensions (especially of matrices) and hence indices are restricted to 
2^31-1, although total array size is limited by available storage.  If 
we support more, people will expect to do matrix operations on such 
matrices, and that is going to need versions of e.g. LAPACK which work 
with 64-bit integers.  Modern Fortran allows different INTEGER sizes to 
interwork, but most of the matrix code is not written in modern Fortran. 
  If compiling them from source it would likely be possible to include 
both 32-bit and 64-bit matrix libraries, but this will be tricky at best 
with enhanced BLAS/LAPACK which often do have both 32- and 64-bit 
versions but using the same entry-point names.

Ironically there were versions of S-PLUS with 64-bit integers.  But only 
64-bit integers as in S pointers and integers had to be the same size. 
That is not something we could contemplate for R, as vast numbers of 
packages assume that R's integers map to C int (tested to be 32-bit) and 
Fortran 32-bit INTEGER.
It would have been helpful to tell us what you wanted to do with them.