View source: R/sums.R
Using the Kahan method, take a more accurate sum
A vector of numbers to sum.
Sum of numbers
sum(c(1,1e100,1,-1e100)) ## Should be 2, gives 0
kahanSum(c(1,1e100,1,-1e100)) ## Not accurate enough for the correct result. (still = 0)
Add the following code to your website.
Copy to clipboard
For more information on customizing the embed code, read Embedding Snippets.