[Rd] request for use cases for larger integers in R

Davis Vaughan d@v|@ @end|ng |rom po@|t@co
Wed Oct 7 16:45:54 CEST 2026


The clock package can represent up to nanosecond durations and time points
without loss of precision, but this requires splitting an `int64_t` into
two `double` values to hold on the R side. I'm fairly certain this would
have been much easier if R had a native `int64_t` backed type. I remember
choosing to use two `double`s so that I could still use `NA_real_` to mean
"missing" without colliding with any valid `int64_t` value
https://github.com/r-lib/clock/blob/f9ab06db5d6d7cc913e0dfa3bfde794554baaad8/src/duration.h#L133-L184

On Fri, Jul 24, 2026 at 2:05 PM luke-tierney--- via R-devel <
r-devel using r-project.org> wrote:

> R integers are current limited to a magnitude ot 2^31 - 1. Integer
> values up to a magnitude of 2^53 can be represented exatcly as
> doubles. At times it would be useful to be able to handle larger
> values.
>
> Several options for adding support for large integers to R are under
> consideration, each with advantages and disadvantages. To help with
> deciding how to move forward it would be helpful to have a collection
> of use cases where something is either difficult or impossible to
> achieve with the current R integer representations. Examples would be
> most helpful if they are concrete enough to allow us to build test
> cases.
>
> Thanks,
>
> luke
>
> --
> Luke Tierney
> Professor Emeritus
> Department of Statistics and
>     Actuarial Science
> University of Iowa
> 241 Schaeffer Hall                  email:   luke-tierney using uiowa.edu
> Iowa City, IA 52242                 WWW:  http://stat.uiowa.edu
>
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

	[[alternative HTML version deleted]]



More information about the R-devel mailing list