Reputation: 3726
Performing (-954437177*4294895519) %% 4294967296
in R gives 1908882432
instead of 1908882329
. Is there a way in R to compute the correct value?
Upvotes: 0
Views: 34
Reputation: 176648
Use a package that supports larger integers (e.g. gmp):
library(gmp)
> mod.bigz(-as.bigz(954437177)*as.bigz(4294895519), as.bigz(4294967296))
Big Integer ('bigz') :
[1] 1908882329
Upvotes: 2