Skip to main content
Module

x/simplestatistic/src/sum.js

simple statistics for node & browser javascript
import * as simplestatistic from "https://deno.land/x/simplestatistic@v7.7.1/src/sum.js";

Functions

Our default sum is the Kahan-Babuska algorithm. This method is an improvement over the classical Kahan summation algorithm. It aims at computing the sum of a list of numbers while correcting for floating-point errors. Traditionally, sums are calculated as many successive additions, each one with its own floating-point roundoff. These losses in precision add up as the number of numbers increases. This alternative algorithm is more accurate than the simple way of calculating sums by simple addition.