In the case of strings that represent values that are out of the range of representable values by a long long, strtoll() will return LLONG_MAX or LLONG_MIN and set errno to ERANGE.
bit64::as.integer64("12312312423432842390482390482348328992382930482093842384092842834238904823908423904230423908924300")
#> integer64
#> [1] 9223372036854775807
See the Return Value section of:
http://www.cplusplus.com/reference/cstdlib/strtoll/
I imagine that after calling strtoll() here you could check errno, and return NA if it is set to ERANGE (possibly with a warning), which seems like it might be better behavior for R
https://github.com/truecluster/bit64/blob/e428535bc31982d85bc3f4faa1f2ae8481280781/src/integer64.c#L205
In the case of strings that represent values that are out of the range of representable values by a
long long,strtoll()will returnLLONG_MAXorLLONG_MINand seterrnotoERANGE.See the Return Value section of:
http://www.cplusplus.com/reference/cstdlib/strtoll/
I imagine that after calling
strtoll()here you could checkerrno, and returnNAif it is set toERANGE(possibly with a warning), which seems like it might be better behavior for Rhttps://github.com/truecluster/bit64/blob/e428535bc31982d85bc3f4faa1f2ae8481280781/src/integer64.c#L205