> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> 同时计算一个 bfloat16 数值样本在不同级别上的多个近似分位数。

# quantilesBFloat16

<div id="quantilesBFloat16">
  ## quantilesBFloat16
</div>

引入版本：v21.7.0

同时计算由 [bfloat16](https://en.wikipedia.org/wiki/Bfloat16_floating-point_format) 数值组成的[样本](https://en.wikipedia.org/wiki/Quantile)在不同级别上的多个近似分位数。

此函数等同于 [`quantileBFloat16`](/docs/zh/reference/functions/aggregate-functions/quantileBFloat16)，但支持在单次遍历中计算多个分位数级别，因此比逐个调用分位数函数更高效。

**语法**

```sql theme={null}
quantilesBFloat16(level1, level2, ...)(expr)
```

**参数**

* `level` — 分位数的级别。一个或多个取值在 0 到 1 之间的常量浮点数。建议将 `level` 的值设在 `[0.01, 0.99]` 范围内。[`Float*`](/docs/zh/reference/data-types/float)

**Arguments**

* `expr` — 基于列值计算的表达式，其结果为数值数据类型、`Date` 或 `DateTime`。[`(U)Int*`](/docs/zh/reference/data-types/int-uint) 或 [`Float*`](/docs/zh/reference/data-types/float) 或 [`Date`](/docs/zh/reference/data-types/date) 或 [`DateTime`](/docs/zh/reference/data-types/datetime)

**返回值**

按指定顺序返回各个指定级别的近似分位数组。对于 `Date` 和 `DateTime` 输入，输出格式与输入格式一致。[`Array(Float64)`](/docs/zh/reference/data-types/array) 或 [`Array(Date)`](/docs/zh/reference/data-types/array) 或 [`Array(DateTime)`](/docs/zh/reference/data-types/array)

**示例**

**计算多个 bfloat16 分位数**

```sql title=Query theme={null}
SELECT quantilesBFloat16(0.25, 0.5, 0.75)(number) FROM numbers(10)
```

```response title=Response theme={null}
┌─quantilesBFloat16(0.25, 0.5, 0.75)(number)─┐
│ [2,4,7]                                    │
└────────────────────────────────────────────┘
```
