sumKahan

Calculates the sum of the numbers with Kahan compensated summation algorithm
Slower than sum function.
The compensation works only for Float types.

Syntax

  1. sumKahan(x)

Arguments

Returned value

Example

Query:

  1. SELECT sum(0.1), sumKahan(0.1) FROM numbers(10);

Result:

  1. ┌───────────sum(0.1)─┬─sumKahan(0.1)─┐
  2. 0.9999999999999999 1
  3. └────────────────────┴───────────────┘