From mdowle at mdowle.plus.com  Wed Mar 20 13:56:35 2013
From: mdowle at mdowle.plus.com (Matthew Dowle)
Date: Wed, 20 Mar 2013 12:56:35 +0000
Subject: [Rd] double in summary.c : isum
Message-ID: <5595fbfb430053bff583ff078ed607ef@imap.plus.net>


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



[Rd] double in summary.c : isum
Matthew Dowle