Utilities for aggregating sequences.
Utilities for aggregating sequences.
(kahan-sum)
(kahan-sum [sum c] x)
Implements a fold that tracks the summation of a sequence of floating point numbers, using Kahan's trick for maintaining stability in the face of accumulating floating point errors.
Implements a fold that tracks the summation of a sequence of floating point numbers, using Kahan's trick for maintaining stability in the face of accumulating floating point errors.
(scanning-sum xs)
(scanning-sum f low high)
Returns every intermediate summation from summing either:
xs
of numbers, orf
to (range low high)
Using Kahan's summation trick behind the scenes to keep floating point errors under control.
Returns every intermediate summation from summing either: - a series `xs` of numbers, or - the result of mapping function `f` to `(range low high)` Using Kahan's summation trick behind the scenes to keep floating point errors under control.
(sum xs)
(sum f low high)
Sums either:
xs
of numbers, orf
to (range low high)
Using Kahan's summation trick behind the scenes to keep floating point errors under control.
Sums either: - a series `xs` of numbers, or - the result of mapping function `f` to `(range low high)` Using Kahan's summation trick behind the scenes to keep floating point errors under control.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close