[Rd] double in summary.c : isum

Matthew Dowle mdowle at mdowle.plus.com
Wed Mar 20 13:56:35 CET 2013


Hi,

Please consider the following :

> x = as.integer(2^30-1)
[1] 1073741823
> sum(c(rep(x, 10000000), rep(-x,9999999)))
[1] 1073741824

Tested on 2.15.2 and a recent R-devel (r62132).

I'm wondering if s in isum could be LDOUBLE instead of double, like 
rsum, to fix this edge case?

https://svn.r-project.org/R/trunk/src/main/summary.c

Thanks,
Matthew



More information about the R-devel mailing list