Description Usage Arguments Details Value Examples
Find the sum of a vector
1 2 3 4 5 |
x |
a vector of numbers to be summed |
naivesum
calculates the sum of a vector by keeping a counter
and repeatedly adding the next value to the interim sum.
kahansum
uses Kahan's algorithm to capture the low-order
precision loss and ensure that the loss is reintegrated into the
final sum. pwisesum
is a recursive implementation of the
piecewise summation algorithm that divides the vector in two and adds
the individual vector sums for a result.
the sum
1 2 3 4 5 6 7 8 9 |
[1] -59243315009
[1] -59243315009
[1] -59243315009
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.