This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push:
new 463c3b3d451 [doc] add case for some math function (#2906)
463c3b3d451 is described below
commit 463c3b3d451212d5bd685aa656f9f3b49e563724
Author: Mryange <[email protected]>
AuthorDate: Sat Oct 11 16:30:17 2025 +0800
[doc] add case for some math function (#2906)
## Versions
- [x] dev
- [ ] 3.0
- [ ] 2.1
- [ ] 2.0
## Languages
- [x] Chinese
- [x] English
## Docs Checklist
- [ ] Checked by AI
- [ ] Test Cases Built
---
.../scalar-functions/numeric-functions/abs.md | 13 ++
.../scalar-functions/numeric-functions/bin.md | 15 +-
.../scalar-functions/numeric-functions/ceil.md | 14 ++
.../scalar-functions/numeric-functions/conv.md | 26 ++++
.../scalar-functions/numeric-functions/even.md | 19 ++-
.../scalar-functions/numeric-functions/exp.md | 19 ++-
.../scalar-functions/numeric-functions/floor.md | 14 ++
.../scalar-functions/numeric-functions/fmod.md | 30 ++--
.../scalar-functions/numeric-functions/gcd.md | 13 ++
.../scalar-functions/numeric-functions/lcm.md | 15 +-
.../scalar-functions/numeric-functions/ln.md | 26 ++++
.../scalar-functions/numeric-functions/log.md | 30 +++-
.../scalar-functions/numeric-functions/log10.md | 29 +++-
.../scalar-functions/numeric-functions/log2.md | 29 +++-
.../numeric-functions/normal-cdf.md | 13 ++
.../scalar-functions/numeric-functions/sign.md | 14 ++
.../scalar-functions/numeric-functions/signbit.md | 13 ++
.../scalar-functions/numeric-functions/abs.md | 14 +-
.../scalar-functions/numeric-functions/bin.md | 15 +-
.../scalar-functions/numeric-functions/ceil.md | 14 ++
.../scalar-functions/numeric-functions/conv.md | 26 ++++
.../scalar-functions/numeric-functions/even.md | 13 ++
.../scalar-functions/numeric-functions/exp.md | 14 ++
.../scalar-functions/numeric-functions/floor.md | 14 ++
.../scalar-functions/numeric-functions/fmod.md | 14 +-
.../scalar-functions/numeric-functions/gcd.md | 13 ++
.../scalar-functions/numeric-functions/lcm.md | 14 +-
.../scalar-functions/numeric-functions/ln.md | 29 +++-
.../scalar-functions/numeric-functions/log.md | 28 +++-
.../scalar-functions/numeric-functions/log10.md | 3 +-
.../scalar-functions/numeric-functions/log2.md | 27 +++-
.../scalar-functions/numeric-functions/negative.md | 2 +
.../numeric-functions/normal-cdf.md | 13 ++
.../numeric-functions/running-difference.md | 168 ---------------------
.../scalar-functions/numeric-functions/sign.md | 14 ++
.../scalar-functions/numeric-functions/signbit.md | 13 ++
36 files changed, 583 insertions(+), 197 deletions(-)
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/abs.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/abs.md
index ca91ce32162..c733c76f619 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/abs.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/abs.md
@@ -24,6 +24,7 @@ ABS(<x>)
## Return Value
The absolute value of parameter `x`.
+When `x` is NULL, returns NULL.
## Example
@@ -62,3 +63,15 @@ select abs(-3254654236547654354654767);
| 3254654236547654354654767 |
+---------------------------------+
```
+
+```sql
+select abs(NULL);
+```
+
+```text
++-----------+
+| abs(NULL) |
++-----------+
+| NULL |
++-----------+
+```
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/bin.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/bin.md
index 3aa5a1dfdaa..776d97d2d54 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/bin.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/bin.md
@@ -19,11 +19,12 @@ BIN(<a>)
| Parameter | Description |
| -- | -- |
-| `<a>` | Decimal value to be converted |
+| `<a>` | Decimal value to be converted (type: BigInt) |
## Return Value
The binary representation of the parameter `<a>`. When `<a>` is negative, the
result is its 64-bit complement.
+When `a` is NULL, returns NULL.
## Examples
@@ -62,3 +63,15 @@ select bin(123);
| 1111011 |
+----------+
```
+
+```sql
+select bin(NULL);
+```
+
+```text
++-----------+
+| bin(NULL) |
++-----------+
+| NULL |
++-----------+
+```
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/ceil.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/ceil.md
index fe8ca560f65..3f446a5e320 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/ceil.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/ceil.md
@@ -34,6 +34,8 @@ For an entry `<a>` of type Decimal, assuming it is of type
`Decimal(p, s)`, the
- `Decimal(p, <d>)`,if `0 < <d> <= s`
- `Decimal(p, s)`,if `<d> > s`
+When any input parameter is NULL, returns NULL.
+
## Alias
- DCEIL
@@ -104,3 +106,15 @@ select ceil(x, 2) from ( select cast(123.456 as
decimal(6,3)) as x from numbers(
| 123.46 |
+------------+
```
+
+```sql
+select ceil(NULL);
+```
+
+```text
++------------+
+| ceil(NULL) |
++------------+
+| NULL |
++------------+
+```
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/conv.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/conv.md
index 2f3f2e1b3b5..1c57f576b0b 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/conv.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/conv.md
@@ -26,6 +26,8 @@ CONV(<input>, <from_base>, <to_base>)
## Return Value
The number under the converted target binary `<to_base>` is returned as a
string.
+When any input parameter is NULL, returns NULL.
+If `<from_base>` or `<to_base>` does not meet the range requirement, returns
NULL.
## Examples
@@ -64,3 +66,27 @@ SELECT CONV(230,10,16);
| E6 |
+-------------------+
```
+
+```sql
+SELECT CONV(230,10,NULL);
+```
+
+```text
++-------------------+
+| CONV(230,10,NULL) |
++-------------------+
+| NULL |
++-------------------+
+```
+
+```sql
+SELECT CONV(230,10,56);
+```
+
+```text
++-----------------+
+| CONV(230,10,56) |
++-----------------+
+| NULL |
++-----------------+
+```
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/even.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/even.md
index 4d30424e9d5..e7d82eecb06 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/even.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/even.md
@@ -43,7 +43,12 @@ EVEN(<a>)
## Return Value
-Returns the smallest even integer that is greater than or equal to x when x >
0, or less than or equal to x when x < 0.
+Returns an even integer based on the following rules:
+
+- If x > 0, round up to the closest even number.
+- If x < 0, round down to the closest even number.
+- If x is already an even number, return it directly.
+- If x is NULL, returns NULL.
## Examples
@@ -81,4 +86,16 @@ select even(4);
+--------+
| 4 |
+--------+
+```
+
+```sql
+select even(NULL);
+```
+
+```text
++------------+
+| even(NULL) |
++------------+
+| NULL |
++------------+
```
\ No newline at end of file
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/exp.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/exp.md
index 8c732247605..1355690b845 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/exp.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/exp.md
@@ -27,8 +27,9 @@ EXP(<x>)
## Return Value
-Return a value of type double
-- If the parameter has a null value, it returns NULL
+Return a value of type double. Special cases:
+- If the parameter is NULL, returns NULL
+- When the parameter is quite large, returns Infinity
## Example
@@ -44,7 +45,7 @@ select exp(2);
+------------------+
```
-```
+```sql
select exp(3.4);
```
@@ -55,3 +56,15 @@ select exp(3.4);
| 29.964100047397011 |
+--------------------+
```
+
+```sql
+select exp(1000000);
+```
+
+```text
++--------------+
+| EXP(1000000) |
++--------------+
+| Infinity |
++--------------+
+```
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/floor.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/floor.md
index b25257ecdb8..449eec153e5 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/floor.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/floor.md
@@ -34,6 +34,8 @@ For an entry `<a>` of type Decimal, assuming it is of type
`Decimal(p, s)`, the
- `Decimal(p, <d>)`,if `0 < <d> <= s`
- `Decimal(p, s)`,if `<d> > s`
+When any input parameter is NULL, returns NULL.
+
## Alias
- DFLOOR
@@ -103,3 +105,15 @@ select floor(x, 2) from ( select cast(123.456 as
decimal(6,3)) as x from numbers
| 123.45 |
+-------------+
```
+
+```sql
+select floor(NULL, 2);
+```
+
+```text
++----------------+
+| floor(NULL, 2) |
++----------------+
+| NULL |
++----------------+
+```
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/fmod.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/fmod.md
index 431a5af5fc8..ee4cea5185e 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/fmod.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/fmod.md
@@ -7,28 +7,28 @@
## Description
-Find the remainder of a / b for the floating-point type. For the integer type,
please use the mod function.
+Calculate the modulo of floating-point numbers, a / b. For integer types,
please use the mod function.
## Syntax
```sql
-MOD(<col_a> , <col_b>)
+FMOD(<col_a> , <col_b>)
```
## Parameters
| Parameter | Description |
-|-----------|------------|
-| `<col_a>` | Dividend |
-| `<col_b>` | Divisor should not be 0 |
+| -- | -- |
+| `<col_a>` | Dividend |
+| `<col_b>` | Divisor (cannot be 0) |
-## Return value
+## Return Value
-Return a float-point type. Special cases:
+Returns a floating-point number. Special cases:
-If col_a IS NULL or col_b IS NULL, return NULL.
+- When any input parameter is NULL, returns NULL.
-## Example
+## Examples
```sql
select fmod(10.1, 3.2);
@@ -52,4 +52,16 @@ select fmod(10.1, 0);
+---------------+
| NULL |
+---------------+
+```
+
+```sql
+select fmod(10.1, NULL);
+```
+
+```text
++------------------+
+| fmod(10.1, NULL) |
++------------------+
+| NULL |
++------------------+
```
\ No newline at end of file
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/gcd.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/gcd.md
index ae1da307f57..753ee232c26 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/gcd.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/gcd.md
@@ -45,6 +45,7 @@ GCD(<a>, <b>)
## Return Value
Returns the greatest common divisor of `<a>` and `<b>`.
+If any input is NULL, returns NULL.
## Examples
@@ -82,4 +83,16 @@ select gcd(0, 10);
+-----------+
| 10 |
+-----------+
+```
+
+```sql
+select gcd(54, NULL);
+```
+
+```text
++---------------+
+| gcd(54, NULL) |
++---------------+
+| NULL |
++---------------+
```
\ No newline at end of file
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/lcm.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/lcm.md
index 5a3dc37d1f9..0d005d68ae4 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/lcm.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/lcm.md
@@ -26,7 +26,7 @@ under the License.
## Description
-Calculates the least common multiple (LCM) of two integers.Note that the
result may overflow.
+Calculates the least common multiple (LCM) of two integers. Note that the
result may overflow.
## Syntax
@@ -45,6 +45,7 @@ LCM(<a>, <b>)
## Return Value
Returns the least common multiple of `<a>` and `<b>`.
+If any input is NULL, returns NULL.
## Examples
@@ -90,4 +91,16 @@ select lcm(-170141183460469231731687303715884105728, 3);
```text
ERROR 1105 (HY000): errCode = 2, detailMessage = Can not convert to legacy
literal: 510423550381407695195061911147652317184
+```
+
+```sql
+select lcm(-4, NULL);
+```
+
+```text
++---------------+
+| lcm(-4, NULL) |
++---------------+
+| NULL |
++---------------+
```
\ No newline at end of file
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/ln.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/ln.md
index 4145ef349c6..a199d0b7965 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/ln.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/ln.md
@@ -30,6 +30,8 @@ LN(<x>)
Return a float-point number. Special cases:
- If x IS NULL, return NULL
+- If x IS NaN, return NaN
+- If x is positive infinity or negative infinity, return NULL
## Example
@@ -67,4 +69,28 @@ select ln(10);
+------------------------+
| 2.302585092994046 |
+------------------------+
+```
+
+```sql
+select ln(cast('inf' as double));
+```
+
+```text
++---------------------------+
+| ln(cast('inf' as double)) |
++---------------------------+
+| Infinity |
++---------------------------+
+```
+
+```sql
+select ln(cast('nan' as double));
+```
+
+```text
++---------------------------+
+| ln(cast('nan' as double)) |
++---------------------------+
+| NaN |
++---------------------------+
```
\ No newline at end of file
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/log.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/log.md
index 956bb891a0f..c8208348cc0 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/log.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/log.md
@@ -24,9 +24,11 @@ LOG(<b>[, <x>])
## Return value
-Return b float point number. Special cases:
+Return a float point number. Special cases:
-- If a IS NULL or x IS NULL, return NULL
+- If b IS NULL or x IS NULL, return NULL
+- If any parameter is NaN, return NaN
+- If parameters don't meet the input constraints, return NULL
## Example
@@ -100,4 +102,28 @@ select log(NULL,3);
+------------------------------+
| NULL |
+------------------------------+
+```
+
+```sql
+select log(2 ,cast('nan' as double));
+```
+
+```text
++-------------------------------+
+| log(2 ,cast('nan' as double)) |
++-------------------------------+
+| NaN |
++-------------------------------+
+```
+
+```sql
+select log(2 ,-1);
+```
+
+```text
++------------+
+| log(2 ,-1) |
++------------+
+| NULL |
++------------+
```
\ No newline at end of file
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/log10.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/log10.md
index 92641bf9ca8..bf7fc3ceb79 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/log10.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/log10.md
@@ -27,9 +27,10 @@ LOG10(<x>)
## Return value
-Returns a floating-point number.
+Returns a floating-point number. Special cases:
-- If x IS NULL: return `NULL`
+- If x IS NULL, return `NULL`
+- If x IS NaN, return NaN
## Example
@@ -69,4 +70,28 @@ select log10(16);
+---------------------------+
```
+```sql
+select log10(NULL);
+```
+
+```text
++-------------+
+| log10(NULL) |
++-------------+
+| NULL |
++-------------+
+```
+
+```sql
+select log10(cast('nan' as double));
+```
+
+```text
++------------------------------+
+| log10(cast('nan' as double)) |
++------------------------------+
+| NaN |
++------------------------------+
+```
+
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/log2.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/log2.md
index 2e19317747d..fff5fbe5905 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/log2.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/log2.md
@@ -23,9 +23,10 @@ LOG2(<x>)
## Return value
-Returns a floating-point number.
+Returns a floating-point number. Special cases:
-- If x IS NULL: return `NULL`
+- If x IS NULL, return `NULL`
+- If x IS NaN, return NaN
## Example
@@ -64,3 +65,27 @@ select log2(10);
| 3.3219280948873626 |
+--------------------------+
```
+
+```sql
+select log2(NULL);
+```
+
+```text
++------------+
+| log2(NULL) |
++------------+
+| NULL |
++------------+
+```
+
+```sql
+select log2(cast('Nan' as double));
+```
+
+```text
++-----------------------------+
+| log2(cast('Nan' as double)) |
++-----------------------------+
+| NaN |
++-----------------------------+
+```
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/normal-cdf.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/normal-cdf.md
index 712f6555e1d..2af16e4c35e 100644
---
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/normal-cdf.md
+++
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/normal-cdf.md
@@ -30,6 +30,7 @@ NORMAL_CDF(<mean>, <sd>, <x>)
Return the Cumulative distribution Function (CDF) for a Normal random variable
at a value `x`.
- Return `NULL` when standard deviation of the normal distribution is less
than or equal to `0`.
+- If any input is NULL, returns NULL.
## Examples
@@ -56,3 +57,15 @@ select NORMAL_CDF(10, 0, 10);
| NULL |
+-----------------------------------------------------------------------+
```
+
+```sql
+select normal_cdf(10, 9, NULL);
+```
+
+```text
++-------------------------+
+| normal_cdf(10, 9, NULL) |
++-------------------------+
+| NULL |
++-------------------------+
+```
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/sign.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/sign.md
index 155ca6f8b53..d9c42aaf64e 100644
--- a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/sign.md
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/sign.md
@@ -33,6 +33,8 @@ Returns an integer:
- If x is NULL, it returns NULL.
+Note that for floating-point positive and negative zeros, they all return 0
here. If you want to distinguish between positive and negative zeros of
floating-point numbers, you can use the `<signbit>` function.
+
## Example
```sql
@@ -82,3 +84,15 @@ select sign(null);
| NULL |
+------------+
```
+
+```sql
+select sign(cast('+0.0' as double)) , sign(cast('-0.0' as double));
+```
+
+```text
++------------------------------+------------------------------+
+| sign(cast('+0.0' as double)) | sign(cast('-0.0' as double)) |
++------------------------------+------------------------------+
+| 0 | 0 |
++------------------------------+------------------------------+
+```
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/signbit.md
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/signbit.md
index 5e13af6dcfb..33b40489862 100644
---
a/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/signbit.md
+++
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/signbit.md
@@ -43,6 +43,7 @@ SIGNBIT(<a>)
## Return Value
Returns true if the sign bit of `<a>` is set (i.e., `<a>` is negative),
otherwise returns false.
+Specifically, it can also distinguish between positive and negative zeros in
floating-point numbers.
## Examples
@@ -80,4 +81,16 @@ select signbit(1.0);
+----------------------------+
| false |
+----------------------------+
+```
+
+```sql
+select signbit(cast('+0.0' as double)) , signbit(cast('-0.0' as double));
+```
+
+```text
++---------------------------------+---------------------------------+
+| signbit(cast('+0.0' as double)) | signbit(cast('-0.0' as double)) |
++---------------------------------+---------------------------------+
+| 0 | 1 |
++---------------------------------+---------------------------------+
```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/abs.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/abs.md
index 49381bfb2e6..2ec74f7fce0 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/abs.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/abs.md
@@ -23,7 +23,7 @@ ABS(<x>)
## 返回值
-参数 x 的绝对值
+参数 x 的绝对值,当 `x` 为 NULL 时,返回 NULL
## 举例
@@ -62,3 +62,15 @@ select abs(-3254654236547654354654767);
| 3254654236547654354654767 |
+---------------------------------+
```
+
+```sql
+select abs(NULL);
+```
+
+```text
++-----------+
+| abs(NULL) |
++-----------+
+| NULL |
++-----------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/bin.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/bin.md
index e763028f01c..5c95231c375 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/bin.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/bin.md
@@ -19,11 +19,12 @@ bin(<a>)
| 参数 | 说明 |
| -- | -- |
-| `<a>` | 需要转换的十进制值 |
+| `<a>` | 需要转换的十进制值(类型为BigInt) |
## 返回值
参数 `<a>` 的二进制表示。当 `<a>` 为负数时,结果为其 64 位补码表示。
+当 `a` 为 NULL 时,返回 NULL。
## 举例
@@ -62,3 +63,15 @@ select bin(123);
| 1111011 |
+----------+
```
+
+```sql
+select bin(NULL);
+```
+
+```text
++-----------+
+| bin(NULL) |
++-----------+
+| NULL |
++-----------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/ceil.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/ceil.md
index bfc5b990318..db070c13b3c 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/ceil.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/ceil.md
@@ -34,6 +34,8 @@ CEIL(<a>[, <d>])
- `Decimal(p, <d>)`,若 `0 < <d> <= s`
- `Decimal(p, s)`,若 `<d> > s`
+任意一个输入参数为 NULL 时,返回 NULL。
+
## 别名
- DCEIL
@@ -104,3 +106,15 @@ select ceil(x, 2) from ( select cast(123.456 as
decimal(6,3)) as x from numbers(
| 123.46 |
+------------+
```
+
+```sql
+select ceil(NULL);
+```
+
+```text
++------------+
+| ceil(NULL) |
++------------+
+| NULL |
++------------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/conv.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/conv.md
index e63156b765f..9671dac9aa5 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/conv.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/conv.md
@@ -26,6 +26,8 @@ CONV(<input>, <from_base>, <to_base>)
## 返回值
转换后目标进制 `<to_base>` 下的数字,以字符串形式返回。
+任意一个输入参数为 NULL 时,返回 NULL。
+如果<from_base>,<to_base>不满足范围限制,返回 NULL。
## 举例
@@ -64,3 +66,27 @@ SELECT CONV(230,10,16);
| E6 |
+-------------------+
```
+
+```sql
+SELECT CONV(230,10,NULL);
+```
+
+```text
++-------------------+
+| CONV(230,10,NULL) |
++-------------------+
+| NULL |
++-------------------+
+```
+
+```sql
+SELECT CONV(230,10,56);
+```
+
+```text
++-----------------+
+| CONV(230,10,56) |
++-----------------+
+| NULL |
++-----------------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/even.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/even.md
index 9c302c39a31..bbcdda691f9 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/even.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/even.md
@@ -50,6 +50,7 @@ EVEN(<a>)
- 若 x < 0,则向下舍入到最接近的偶数;
- 若 x 本身为偶数,则直接返回。
+ - 若 x 为 NULL,返回 NULL
## Examples
@@ -87,4 +88,16 @@ select even(4);
+--------+
| 4 |
+--------+
+```
+
+```sql
+select even(NULL);
+```
+
+```text
++------------+
+| even(NULL) |
++------------+
+| NULL |
++------------+
```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/exp.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/exp.md
index d89ee57729f..c6a0bf41766 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/exp.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/exp.md
@@ -31,6 +31,8 @@ EXP(<x>)
- 当参数为`NULL`时,返回 NULL
+- 当参数为比较大的时候,返回 Infinity
+
## 举例
```sql
@@ -56,3 +58,15 @@ select exp(3.4);
| 29.964100047397011 |
+--------------------+
```
+
+```sql
+select exp(1000000);
+```
+
+```text
++--------------+
+| EXP(1000000) |
++--------------+
+| Infinity |
++--------------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/floor.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/floor.md
index 30d2a6e4ce4..83f4e846458 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/floor.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/floor.md
@@ -34,6 +34,8 @@ FLOOR(<a>[, <d>])
- `Decimal(p, <d>)`,若 `0 < <d> <= s`
- `Decimal(p, s)`,若 `<d> > s`
+任意一个输入参数为 NULL 时,返回 NULL。
+
## 别名
- DFLOOR
@@ -103,3 +105,15 @@ select floor(x, 2) from ( select cast(123.456 as
decimal(6,3)) as x from numbers
| 123.45 |
+-------------+
```
+
+```sql
+select floor(NULL, 2);
+```
+
+```text
++----------------+
+| floor(NULL, 2) |
++----------------+
+| NULL |
++----------------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/fmod.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/fmod.md
index e8ab77d53d8..6bc04d8623e 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/fmod.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/fmod.md
@@ -26,7 +26,7 @@ MOD(<col_a> , <col_b>)
返回一个浮点数。特殊情况:
-- 当 col_a 为 `NULL` 或 col_b 为 `NULL`时,返回 `NULL`
+- 任意一个输入参数为 NULL 时,返回 NULL。
## 举例
@@ -52,4 +52,16 @@ select fmod(10.1, 0);
+---------------+
| NULL |
+---------------+
+```
+
+```sql
+select fmod(10.1, NULL);
+```
+
+```text
++------------------+
+| fmod(10.1, NULL) |
++------------------+
+| NULL |
++------------------+
```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/gcd.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/gcd.md
index f8b36d63244..4c5fcd86d9e 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/gcd.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/gcd.md
@@ -45,6 +45,7 @@ GCD(<a>, <b>)
## Return Value
返回值为 `<a>` 和 `<b>` 的最大公约数
+任意一个输入为 NULL,返回 NULL
## Examples
@@ -82,4 +83,16 @@ select gcd(0, 10);
+-----------+
| 10 |
+-----------+
+```
+
+```sql
+select gcd(54, NULL);
+```
+
+```text
++---------------+
+| gcd(54, NULL) |
++---------------+
+| NULL |
++---------------+
```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/lcm.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/lcm.md
index 42eb69afbf3..ac3078d72a2 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/lcm.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/lcm.md
@@ -45,7 +45,7 @@ LCM(<a>, <b>)
## Return Value
返回 `<a>` 和 `<b>` 的最小公倍数
-
+任意一个输入为 NULL,返回 NULL
## Examples
```sql
@@ -90,4 +90,16 @@ select lcm(-170141183460469231731687303715884105728, 3);
```text
ERROR 1105 (HY000): errCode = 2, detailMessage = Can not convert to legacy
literal: 510423550381407695195061911147652317184
+```
+
+```sql
+select lcm(-4, NULL);
+```
+
+```text
++---------------+
+| lcm(-4, NULL) |
++---------------+
+| NULL |
++---------------+
```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/ln.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/ln.md
index 2a641457c36..c6ad378dfed 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/ln.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/ln.md
@@ -29,7 +29,10 @@ LN(<x>)
返回一个浮点数。特殊情况:
-- 当 x IS NULL 时,返回`NULL`
+- 当 `x` 为 NULL 时,返回`NULL`
+- 当 `x` 为 NaN 时,返回 NaN
+- 当 `x` 为正无穷大或负无穷大时,返回 `NULL`
+- 当 `x` 为 NULL 时,返回 NULL
## 举例
@@ -67,4 +70,28 @@ select ln(10);
+------------------------+
| 2.302585092994046 |
+------------------------+
+```
+
+```sql
+select ln(cast('inf' as double));
+```
+
+```text
++---------------------------+
+| ln(cast('inf' as double)) |
++---------------------------+
+| Infinity |
++---------------------------+
+```
+
+```sql
+select ln(cast('nan' as double));
+```
+
+```text
++---------------------------+
+| ln(cast('nan' as double)) |
++---------------------------+
+| NaN |
++---------------------------+
```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/log.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/log.md
index ef89e2c9b47..66da98a81cf 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/log.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/log.md
@@ -20,13 +20,15 @@ LOG(<b>[, <x>])
| 参数 | 说明 |
|-------| -- |
| `<b>` | 底数 必须大于 0 且不等于 1 |
-| `<x>` | 可选,真数必须大于 0,默认为自然数e |
+| `<x>` | 可选,真数必须大于 0,默认为自然数 e |
## 返回值
返回一个浮点数。特殊情况:
- 当 b 为 NULL 或 x 为 NULL 时,返回`NULL`
+- 当 任意一个参数 NaN 时,返回 NaN
+- 当 参数不满足输入限制时,返回 NULL
## 举例
@@ -100,4 +102,28 @@ select log(NULL,3);
+------------------------------+
| NULL |
+------------------------------+
+```
+
+```sql
+select log(2 ,cast('nan' as double));
+```
+
+```text
++-------------------------------+
+| log(2 ,cast('nan' as double)) |
++-------------------------------+
+| NaN |
++-------------------------------+
+```
+
+```sql
+select log(2 ,-1);
+```
+
+```text
++------------+
+| log(2 ,-1) |
++------------+
+| NULL |
++------------+
```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/log10.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/log10.md
index 4978fe2d964..289bb456afe 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/log10.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/log10.md
@@ -29,7 +29,8 @@ LOG10(<x>)
返回一个浮点数。
-- 当 x IS NULL:返回 `NULL`
+- 当 `x` 为 NULL 时,返回 `NULL`
+- 当 `x` 为 NaN 时,返回 NaN
## 举例
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/log2.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/log2.md
index 613266d20b5..e54eecbedc2 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/log2.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/log2.md
@@ -25,7 +25,8 @@ LOG2(<x>)
返回一个浮点数。特殊情况:
-- 当 x 为 NULL 时,返回 `NULL`
+- 当 `x` 为 NULL 时,返回 `NULL`
+- 当 `x` 为 NaN 时,返回 NaN
## 举例
@@ -64,3 +65,27 @@ select log2(10);
| 3.3219280948873626 |
+--------------------------+
```
+
+```sql
+select log2(NULL);
+```
+
+```text
++------------+
+| log2(NULL) |
++------------+
+| NULL |
++------------+
+```
+
+```sql
+select log2(cast('Nan' as double));
+```
+
+```text
++-----------------------------+
+| log2(cast('Nan' as double)) |
++-----------------------------+
+| NaN |
++-----------------------------+
+```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/negative.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/negative.md
index 086146bd71f..49e23e4b9ca 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/negative.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/negative.md
@@ -28,6 +28,8 @@ NEGATIVE(<x>)
- 当参数为 NULL 时,返回 NULL
- 当参数为 0 时,返回 0
+注意对于整数,负数的绝对值范围大于正数的绝对值范围,Doris 不会处理这种特殊情况。
+
## 举例
```sql
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/normal-cdf.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/normal-cdf.md
index 9a610ad63f2..0157522a747 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/normal-cdf.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/normal-cdf.md
@@ -30,6 +30,7 @@ NORMAL_CDF(<mean>, <sd>, <x>)
返回某一正态随机变量在值 `x` 处的累积分布函数 (CDF) 值。
- 当正态分布的标准差小于等于 `0`,则返回 `NULL`。
+- 任意一个输入为`NULL`,则返回 `NULL`。
## 举例
@@ -55,4 +56,16 @@ select NORMAL_CDF(10, 0, 10);
+-----------------------------------------------------------------------+
| NULL |
+-----------------------------------------------------------------------+
+```
+
+```sql
+select normal_cdf(10, 9, NULL);
+```
+
+```text
++-------------------------+
+| normal_cdf(10, 9, NULL) |
++-------------------------+
+| NULL |
++-------------------------+
```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/running-difference.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/running-difference.md
deleted file mode 100644
index 75a5d723558..00000000000
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/running-difference.md
+++ /dev/null
@@ -1,168 +0,0 @@
----
-{
- "title": "RUNNING_DIFFERENCE",
- "language": "zh-CN"
-}
----
-
-## running_difference
-## 描述
-## 语法
-
-`T running_difference(T x)`
-计算数据块中连续行值的差值。该函数的结果取决于受影响的数据块和块中数据的顺序。
-
-计算 running_difference 期间使用的行顺序可能与返回给用户的行顺序不同。所以结果是不稳定的。**此函数会在后续版本中废弃**。
-推荐使用窗口函数完成预期功能。举例如下:
-```sql
--- running difference(x)
-SELECT running_difference(x) FROM t ORDER BY k;
-
--- 窗口函数
-SELECT x - lag(x, 1, 0) OVER (ORDER BY k) FROM t;
-```
-
-## 参数
-`x` - 一列数据。数据类型可以是
TINYINT,SMALLINT,INT,BIGINT,LARGEINT,FLOAT,DOUBLE,DATE,DATETIME,DECIMAL
-
-## 返回值
-第一行返回 0,随后的每一行返回与前一行的差值。
-
-## 举例
-
-```sql
-DROP TABLE IF EXISTS running_difference_test;
-
-CREATE TABLE running_difference_test (
- `id` int NOT NULL COMMENT 'id',
- `day` date COMMENT 'day',
- `time_val` datetime COMMENT 'time_val',
- `doublenum` double NULL COMMENT 'doublenum'
-)
-DUPLICATE KEY(id)
-DISTRIBUTED BY HASH(id) BUCKETS 3
-PROPERTIES (
- "replication_num" = "1"
-);
-
-INSERT into running_difference_test (id, day, time_val,doublenum) values ('1',
'2022-10-28', '2022-03-12 10:41:00', null),
- ('2','2022-10-27',
'2022-03-12 10:41:02', 2.6),
- ('3','2022-10-28',
'2022-03-12 10:41:03', 2.5),
- ('4','2022-9-29',
'2022-03-12 10:41:03', null),
- ('5','2022-10-31',
'2022-03-12 10:42:01', 3.3),
- ('6', '2022-11-08',
'2022-03-12 11:05:04', 4.7);
-
-SELECT * from running_difference_test ORDER BY id ASC;
-
-+------+------------+---------------------+-----------+
-| id | day | time_val | doublenum |
-+------+------------+---------------------+-----------+
-| 1 | 2022-10-28 | 2022-03-12 10:41:00 | NULL |
-| 2 | 2022-10-27 | 2022-03-12 10:41:02 | 2.6 |
-| 3 | 2022-10-28 | 2022-03-12 10:41:03 | 2.5 |
-| 4 | 2022-09-29 | 2022-03-12 10:41:03 | NULL |
-| 5 | 2022-10-31 | 2022-03-12 10:42:01 | 3.3 |
-| 6 | 2022-11-08 | 2022-03-12 11:05:04 | 4.7 |
-+------+------------+---------------------+-----------+
-
-SELECT
- id,
- running_difference(id) AS delta
-FROM
-(
- SELECT
- id,
- day,
- time_val,
- doublenum
- FROM running_difference_test
-)as runningDifference ORDER BY id ASC;
-
-+------+-------+
-| id | delta |
-+------+-------+
-| 1 | 0 |
-| 2 | 1 |
-| 3 | 1 |
-| 4 | 1 |
-| 5 | 1 |
-| 6 | 1 |
-+------+-------+
-
-SELECT
- day,
- running_difference(day) AS delta
-FROM
-(
- SELECT
- id,
- day,
- time_val,
- doublenum
- FROM running_difference_test
-)as runningDifference ORDER BY id ASC;
-
-+------------+-------+
-| day | delta |
-+------------+-------+
-| 2022-10-28 | 0 |
-| 2022-10-27 | -1 |
-| 2022-10-28 | 1 |
-| 2022-09-29 | -29 |
-| 2022-10-31 | 32 |
-| 2022-11-08 | 8 |
-+------------+-------+
-
-SELECT
- time_val,
- running_difference(time_val) AS delta
-FROM
-(
- SELECT
- id,
- day,
- time_val,
- doublenum
- FROM running_difference_test
-)as runningDifference ORDER BY id ASC;
-
-+---------------------+-------+
-| time_val | delta |
-+---------------------+-------+
-| 2022-03-12 10:41:00 | 0 |
-| 2022-03-12 10:41:02 | 2 |
-| 2022-03-12 10:41:03 | 1 |
-| 2022-03-12 10:41:03 | 0 |
-| 2022-03-12 10:42:01 | 58 |
-| 2022-03-12 11:05:04 | 1383 |
-+---------------------+-------+
-
-SELECT
- doublenum,
- running_difference(doublenum) AS delta
-FROM
-(
- SELECT
- id,
- day,
- time_val,
- doublenum
- FROM running_difference_test
-)as runningDifference ORDER BY id ASC;
-
-+-----------+----------------------+
-| doublenum | delta |
-+-----------+----------------------+
-| NULL | NULL |
-| 2.6 | NULL |
-| 2.5 | -0.10000000000000009 |
-| NULL | NULL |
-| 3.3 | NULL |
-| 4.7 | 1.4000000000000004 |
-+-----------+----------------------+
-
-```
-
-### keywords
-
-running_difference
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/sign.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/sign.md
index f47b0f2c5f9..20d9a06bbb2 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/sign.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/sign.md
@@ -33,6 +33,8 @@ SIGN(x)
- 当 x is NULL 时,返回 NULL。
+注意,对于浮点数的正负零,在这里全部返回 0,如果想要区分浮点数的正负零,可以使用 `<signbit>` 函数
+
## 举例
```sql
@@ -81,4 +83,16 @@ select sign(null);
+------------+
| NULL |
+------------+
+```
+
+```sql
+select sign(cast('+0.0' as double)) , sign(cast('-0.0' as double));
+```
+
+```text
++------------------------------+------------------------------+
+| sign(cast('+0.0' as double)) | sign(cast('-0.0' as double)) |
++------------------------------+------------------------------+
+| 0 | 0 |
++------------------------------+------------------------------+
```
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/signbit.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/signbit.md
index 08ac454bc8d..41d8edd69da 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/signbit.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/signbit.md
@@ -43,6 +43,7 @@ SIGNBIT(<a>)
## Return Value
如果 `<a>` 的符号位为负(即 `<a>` 是负数),返回 true,否则返回 false。
+特别的,对于浮点数的正负零,也可以区分。
## Examples
@@ -80,4 +81,16 @@ select signbit(1.0);
+----------------------------+
| false |
+----------------------------+
+```
+
+```sql
+select signbit(cast('+0.0' as double)) , signbit(cast('-0.0' as double));
+```
+
+```text
++---------------------------------+---------------------------------+
+| signbit(cast('+0.0' as double)) | signbit(cast('-0.0' as double)) |
++---------------------------------+---------------------------------+
+| 0 | 1 |
++---------------------------------+---------------------------------+
```
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]