agrueneberg/crochet

Convert integers to doubles if .Machine$integer.max is reached

Closed this issue · 1 comments

> pryr::sexp_type(.Machine$integer.max)
[1] "INTSXP"
> G[.Machine$integer.max]
[1] -0.002505102
> .Machine$integer.max + 1L
[1] NA
> pryr::sexp_type(.Machine$integer.max + 1)
[1] "REALSXP"
> G[.Machine$integer.max + 1]
Error: cannot allocate vector of size 1250.6 Gb
In addition: Warning message:
In convertIndex(x, i, "k") : NAs introduced by coercion to integer range

Fixed in 8de4764. I have decided that this is opt-in with the new allowDoubles parameter so that people implementing for example C code won't get any surprises.