Skip to content
Prev 48273 / 63424 Next

large integer values

On 14/05/2014 10:37, Adrian Du?a wrote:
This isn't an R question, except in so far that R mandates the usual 
convention of C <int> being 32-bit.  However

1) You should use an unsigned integer type.
2) Most compilers have uint64_t but C99/C11 do not require it.  They 
require uint_fast64_t and uintmax_t (which is the widest unsigned int) 
types.
3) double will hold much larger powers, and functions like pow_di (where 
supported) or pow will compute them efficiently for you.  And R has 
R_pow_di in Rmath.h.