mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
Merge pull request #25159 from Slach/docs_add_sumKahan
add sumKahan to RU and EN documentation
This commit is contained in:
commit
664650e7b0
@ -0,0 +1,37 @@
|
||||
---
|
||||
toc_priority: 145
|
||||
---
|
||||
|
||||
# sumKahan {#agg_function-sumKahan}
|
||||
|
||||
Calculates the sum of the numbers with [Kahan compensated summation algorithm](https://en.wikipedia.org/wiki/Kahan_summation_algorithm)
|
||||
|
||||
**Syntax**
|
||||
|
||||
``` sql
|
||||
sumKahan(x)
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
- `x` — Input value, must be [Integer](../../../sql-reference/data-types/int-uint.md), [Float](../../../sql-reference/data-types/float.md), or [Decimal](../../../sql-reference/data-types/decimal.md).
|
||||
|
||||
**Returned value**
|
||||
|
||||
- the sum of numbers, with type [Integer](../../../sql-reference/data-types/int-uint.md), [Float](../../../sql-reference/data-types/float.md), or [Decimal](../../../sql-reference/data-types/decimal.md) depends on type of input arguments
|
||||
|
||||
**Example**
|
||||
|
||||
Query:
|
||||
|
||||
``` sql
|
||||
SELECT sum(0.1), sumKahan(0.1) FROM numbers(10);
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
``` text
|
||||
┌───────────sum(0.1)─┬─sumKahan(0.1)─┐
|
||||
│ 0.9999999999999999 │ 1 │
|
||||
└────────────────────┴───────────────┘
|
||||
```
|
@ -0,0 +1,37 @@
|
||||
---
|
||||
toc_priority: 145
|
||||
---
|
||||
|
||||
# sumKahan {#agg_function-sumKahan}
|
||||
|
||||
Вычисляет сумму с использованием [компенсационного суммирования по алгоритму Кэхэна](https://ru.wikipedia.org/wiki/Алгоритм_Кэхэна)
|
||||
|
||||
**Синтаксис**
|
||||
|
||||
``` sql
|
||||
sumKahan(x)
|
||||
```
|
||||
|
||||
**Аргументы**
|
||||
|
||||
- `x` — Входное значение типа [Integer](../../../sql-reference/data-types/int-uint.md), [Float](../../../sql-reference/data-types/float.md), или [Decimal](../../../sql-reference/data-types/decimal.md).
|
||||
|
||||
**Возвращемое значение**
|
||||
|
||||
- сумма чисел с типом [Integer](../../../sql-reference/data-types/int-uint.md), [Float](../../../sql-reference/data-types/float.md), ил [Decimal](../../../sql-reference/data-types/decimal.md) зависящим от типа входящих аргументов
|
||||
|
||||
**Пример**
|
||||
|
||||
Запрос:
|
||||
|
||||
``` sql
|
||||
SELECT sum(0.1), sumKahan(0.1) FROM numbers(10);
|
||||
```
|
||||
|
||||
Результат:
|
||||
|
||||
``` text
|
||||
┌───────────sum(0.1)─┬─sumKahan(0.1)─┐
|
||||
│ 0.9999999999999999 │ 1 │
|
||||
└────────────────────┴───────────────┘
|
||||
```
|
Loading…
Reference in New Issue
Block a user