This is an automated email from the ASF dual-hosted git repository.

zclll 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 4a956868d54 [doc](function)add docs for math even, signbit, gcd ,lcm 
(#2558)
4a956868d54 is described below

commit 4a956868d54cd12e2ba83f262dad7c9d683e549b
Author: admiring_xm <[email protected]>
AuthorDate: Tue Jul 29 12:23:33 2025 +0800

    [doc](function)add docs for math even, signbit, gcd ,lcm (#2558)
    
    ## 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/even.md     | 84 +++++++++++++++++++
 .../scalar-functions/numeric-functions/gcd.md      | 85 ++++++++++++++++++++
 .../scalar-functions/numeric-functions/lcm.md      | 93 ++++++++++++++++++++++
 .../scalar-functions/numeric-functions/signbit.md  | 83 +++++++++++++++++++
 .../scalar-functions/numeric-functions/even.md     | 90 +++++++++++++++++++++
 .../scalar-functions/numeric-functions/gcd.md      | 85 ++++++++++++++++++++
 .../scalar-functions/numeric-functions/lcm.md      | 93 ++++++++++++++++++++++
 .../scalar-functions/numeric-functions/signbit.md  | 83 +++++++++++++++++++
 sidebars.json                                      |  4 +
 9 files changed, 700 insertions(+)

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
new file mode 100644
index 00000000000..4d30424e9d5
--- /dev/null
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/even.md
@@ -0,0 +1,84 @@
+---
+{
+    "title": "EVEN",
+    "language": "en"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## Description
+
+Round to next even number by rounding away from zero.
+
+## Syntax
+
+```sql
+EVEN(<a>)
+```
+
+
+## Parameters
+
+| Parameter | Description |
+| -- | -- |
+| `<a>` | A numeric expression to round to the next even integer |
+
+## 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.
+
+## Examples
+
+```sql
+select even(2.9);
+```
+
+```text
++----------+
+| even(2.9) |
++----------+
+|        4 |
++----------+
+```
+
+```sql
+select even(-2.9);
+```
+
+```text
++-----------+
+| even(-2.9) |
++-----------+
+|       -4  |
++-----------+
+```
+
+```sql
+select even(4);
+```
+
+```text
++--------+
+| even(4) |
++--------+
+|      4 |
++--------+
+```
\ 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
new file mode 100644
index 00000000000..ae1da307f57
--- /dev/null
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/gcd.md
@@ -0,0 +1,85 @@
+---
+{
+    "title": "GCD",
+    "language": "en"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## Description
+
+Calculates the greatest common divisor (GCD) of two integers.
+
+## Syntax
+
+```sql
+GCD(<a>, <b>)
+```
+
+
+## Parameters
+
+| Parameter | Description |
+| -- | -- |
+| `<a>` | The first integer |
+| `<b>` | The second integer |
+
+## Return Value
+
+Returns the greatest common divisor of `<a>` and `<b>`.
+
+## Examples
+
+```sql
+select gcd(54, 24);
+```
+
+```text
++------------+
+| gcd(54,24) |
++------------+
+|          6 |
++------------+
+```
+
+```sql
+select gcd(-17, 31);
+```
+
+```text
++-------------+
+| gcd(17,31)  |
++-------------+
+|           1 |
++-------------+
+```
+
+```sql
+select gcd(0, 10);
+```
+
+```text
++-----------+
+| gcd(0,10) |
++-----------+
+|        10 |
++-----------+
+```
\ 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
new file mode 100644
index 00000000000..5a3dc37d1f9
--- /dev/null
+++ b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/lcm.md
@@ -0,0 +1,93 @@
+---
+{
+    "title": "LCM",
+    "language": "en"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## Description
+
+Calculates the least common multiple (LCM) of two integers.Note that the 
result may overflow.
+
+## Syntax
+
+```sql
+LCM(<a>, <b>)
+```
+
+
+## Parameters
+
+| Parameter | Description |
+| -- | -- |
+| `<a>` | The first integer |
+| `<b>` | The second integer |
+
+## Return Value
+
+Returns the least common multiple of `<a>` and `<b>`.
+
+## Examples
+
+```sql
+select lcm(12, 18);
+```
+
+```text
++------------+
+| lcm(12,18) |
++------------+
+|         36 |
++------------+
+```
+
+```sql
+select lcm(0, 10);
+```
+
+```text
++-----------+
+| lcm(0,10) |
++-----------+
+|         0 |
++-----------+
+```
+
+```sql
+select lcm(-4, 6);
+```
+
+```text
++------------+
+| lcm(-4,6)  |
++------------+
+|          12|
++------------+
+```
+
+```sql
+select lcm(-170141183460469231731687303715884105728, 3);
+```
+
+```text
+ERROR 1105 (HY000): errCode = 2, detailMessage = Can not convert to legacy 
literal: 510423550381407695195061911147652317184
+```
\ No newline at end of file
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
new file mode 100644
index 00000000000..5e13af6dcfb
--- /dev/null
+++ 
b/docs/sql-manual/sql-functions/scalar-functions/numeric-functions/signbit.md
@@ -0,0 +1,83 @@
+---
+{
+    "title": "SIGNBIT",
+    "language": "en"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## Description
+
+Determine whether the sign bit of the given floating-point number is set.
+
+## Syntax
+
+```sql
+SIGNBIT(<a>)
+```
+
+## Parameters
+
+| Parameter | Description |
+| -- | -- |
+| `<a>` | Floating-point number to check the sign bit for |
+
+## Return Value
+
+Returns true if the sign bit of `<a>` is set (i.e., `<a>` is negative), 
otherwise returns false.
+
+## Examples
+
+```sql
+select signbit(-1.0);
+```
+
+```text
++-----------------------------+
+| signbit(cast(-1 as DOUBLE)) |
++-----------------------------+
+| true                        |
++-----------------------------+
+```
+
+```sql
+select signbit(0.0);
+```
+
+```text
++----------------------------+
+| signbit(cast(0 as DOUBLE)) |
++----------------------------+
+| false                      |
++----------------------------+
+```
+
+```sql
+select signbit(1.0);
+```
+
+```text
++----------------------------+
+| signbit(cast(1 as DOUBLE)) |
++----------------------------+
+| false                      |
++----------------------------+
+```
\ 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
new file mode 100644
index 00000000000..9c302c39a31
--- /dev/null
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/even.md
@@ -0,0 +1,90 @@
+---
+{
+    "title": "EVEN",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## Description
+
+将输入值向零的反方向进位(舍入)到下一个偶数整数。
+
+## Syntax
+
+```sql
+EVEN(<a>)
+```
+
+
+## Parameters
+
+| Parameter | Description |
+| -- | -- |
+| `<a>` | 要舍入为偶数的数值表达式 |
+
+## Return Value
+
+返回一个偶数整数,规则如下:
+
+ - 若 x > 0,则向上舍入到最接近的偶数;
+
+ - 若 x < 0,则向下舍入到最接近的偶数;
+
+ - 若 x 本身为偶数,则直接返回。
+
+## Examples
+
+```sql
+select even(2.9);
+```
+
+```text
++----------+
+| even(2.9) |
++----------+
+|        4 |
++----------+
+```
+
+```sql
+select even(-2.9);
+```
+
+```text
++-----------+
+| even(-2.9) |
++-----------+
+|       -4  |
++-----------+
+```
+
+```sql
+select even(4);
+```
+
+```text
++--------+
+| even(4) |
++--------+
+|      4 |
++--------+
+```
\ 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
new file mode 100644
index 00000000000..f8b36d63244
--- /dev/null
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/gcd.md
@@ -0,0 +1,85 @@
+---
+{
+    "title": "GCD",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## Description
+
+计算两个整数的最大公约数。
+
+## Syntax
+
+```sql
+GCD(<a>, <b>)
+```
+
+
+## Parameters
+
+| Parameter | Description |
+| -- | -- |
+| `<a>` | 第一个整数 |
+| `<b>` | 第二个整数 |
+
+## Return Value
+
+返回值为 `<a>` 和 `<b>` 的最大公约数
+
+## Examples
+
+```sql
+select gcd(54, 24);
+```
+
+```text
++------------+
+| gcd(54,24) |
++------------+
+|          6 |
++------------+
+```
+
+```sql
+select gcd(-17, 31);
+```
+
+```text
++-------------+
+| gcd(17,31)  |
++-------------+
+|           1 |
++-------------+
+```
+
+```sql
+select gcd(0, 10);
+```
+
+```text
++-----------+
+| gcd(0,10) |
++-----------+
+|        10 |
++-----------+
+```
\ 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
new file mode 100644
index 00000000000..42eb69afbf3
--- /dev/null
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/lcm.md
@@ -0,0 +1,93 @@
+---
+{
+    "title": "LCM",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## Description
+
+计算两个整数的最小公倍数。注意结果可能会溢出。
+
+## Syntax
+
+```sql
+LCM(<a>, <b>)
+```
+
+
+## Parameters
+
+| Parameter | Description |
+| -- | -- |
+| `<a>` |      第一个整数 |
+| `<b>` |      第二个整数 |
+
+## Return Value
+
+返回 `<a>` 和 `<b>` 的最小公倍数
+
+## Examples
+
+```sql
+select lcm(12, 18);
+```
+
+```text
++------------+
+| lcm(12,18) |
++------------+
+|         36 |
++------------+
+```
+
+```sql
+select lcm(0, 10);
+```
+
+```text
++-----------+
+| lcm(0,10) |
++-----------+
+|         0 |
++-----------+
+```
+
+```sql
+select lcm(-4, 6);
+```
+
+```text
++------------+
+| lcm(-4,6)  |
++------------+
+|          12|
++------------+
+```
+
+```sql
+select lcm(-170141183460469231731687303715884105728, 3);
+```
+
+```text
+ERROR 1105 (HY000): errCode = 2, detailMessage = Can not convert to legacy 
literal: 510423550381407695195061911147652317184
+```
\ 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
new file mode 100644
index 00000000000..08ac454bc8d
--- /dev/null
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/signbit.md
@@ -0,0 +1,83 @@
+---
+{
+    "title": "SIGNBIT",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## Description
+
+判断给定浮点数的符号位是否为负。
+
+## Syntax
+
+```sql
+SIGNBIT(<a>)
+```
+
+## Parameters
+
+| Parameter | Description |
+| -- | -- |
+| `<a>` | 要检查的浮点数参数 |
+
+## Return Value
+
+如果 `<a>` 的符号位为负(即 `<a>` 是负数),返回 true,否则返回 false。
+
+## Examples
+
+```sql
+select signbit(-1.0);
+```
+
+```text
++-----------------------------+
+| signbit(cast(-1 as DOUBLE)) |
++-----------------------------+
+| true                        |
++-----------------------------+
+```
+
+```sql
+select signbit(0.0);
+```
+
+```text
++----------------------------+
+| signbit(cast(0 as DOUBLE)) |
++----------------------------+
+| false                      |
++----------------------------+
+```
+
+```sql
+select signbit(1.0);
+```
+
+```text
++----------------------------+
+| signbit(cast(1 as DOUBLE)) |
++----------------------------+
+| false                      |
++----------------------------+
+```
\ No newline at end of file
diff --git a/sidebars.json b/sidebars.json
index a947c90214e..ba15225cb6a 100644
--- a/sidebars.json
+++ b/sidebars.json
@@ -1135,6 +1135,10 @@
                                         
"sql-manual/sql-functions/scalar-functions/numeric-functions/truncate",
                                         
"sql-manual/sql-functions/scalar-functions/numeric-functions/uuid_numeric",
                                         
"sql-manual/sql-functions/scalar-functions/numeric-functions/width-bucket",
+                                        
"sql-manual/sql-functions/scalar-functions/numeric-functions/even",
+                                        
"sql-manual/sql-functions/scalar-functions/numeric-functions/signbit",
+                                        
"sql-manual/sql-functions/scalar-functions/numeric-functions/gcd",
+                                        
"sql-manual/sql-functions/scalar-functions/numeric-functions/lcm",
                                         
"sql-manual/sql-functions/scalar-functions/numeric-functions/xor"
                                     ]
                                 },


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to