mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 03:22:14 +00:00
0332558a5f
Signed-off-by: Slach <bloodjazman@gmail.com>
1.2 KiB
1.2 KiB
toc_priority |
---|
145 |
sumKahan
Calculates the sum of the numbers with Kahan compensated summation algorithm Slower than sum function. The compensation works only for Float types.
Syntax
sumKahan(x)
Arguments
Returned value
Example
Query:
SELECT sum(0.1), sumKahan(0.1) FROM numbers(10);
Result:
┌───────────sum(0.1)─┬─sumKahan(0.1)─┐
│ 0.9999999999999999 │ 1 │
└────────────────────┴───────────────┘