[R] Best way to compute a sum

Roger Deangelis xlr82sas at gmail.com
Sat Jul 3 06:23:01 CEST 2010



  Although it does not apply to your series and is impractical,  it seems to
me that the most accurate algorithm might be to add all the rational numbers
whose sum and components can be represented  without error in binary first,
ie 2.5 + .5 or 1/16 + 1/16 + 1/8.

  You could also get very clever and investigate a sum that should have an
exact binary representation when the individual components do not, ie .1 +
.2 + .2 = .5 and correct the sum.

Roger
-- 
View this message in context: http://r.789695.n4.nabble.com/Best-way-to-compute-a-sum-tp2267566p2277096.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list