From 742b8f98632e3cc17b4440b10797090a407f2a37 Mon Sep 17 00:00:00 2001 From: xmh1011 <1197843839@qq.com> Date: Sat, 14 Oct 2023 17:50:45 +0800 Subject: [PATCH] docs: add new mathematical function Signed-off-by: xmh1011 <1197843839@qq.com> --- .../Mathematical/log10.md | 35 +++++++++++++++++++ .../Mathematical/log2.md | 35 +++++++++++++++++++ mkdocs.yml | 2 ++ 3 files changed, 72 insertions(+) create mode 100644 docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/log10.md create mode 100644 docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/log2.md diff --git a/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/log10.md b/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/log10.md new file mode 100644 index 000000000..dfd4557fb --- /dev/null +++ b/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/log10.md @@ -0,0 +1,35 @@ +# **LOG10()** + +## **Description** + +LOG10(X) returns the base-10 logarithm of X. + +## **Syntax** + +``` +> LOG10(X) +``` + +## **Arguments** + +| Arguments | Description | +|-----------|------------------------------------------------| +| X | Required. Any numeric data type supported now. | + +## **Examples** + +```sql +drop table if exists t1; +create table t1(a float, b float); +insert into t1 values(10000,3784.159); +insert into t1 values(2738,682.325); + +mysql> select log10(a),log10(b) from t1; ++-------------------+--------------------+ +| log10(a) | log10(b) | ++-------------------+--------------------+ +| 4 | 3.577969368581086 | +| 3.437433443797971 | 2.8339912916439594 | ++-------------------+--------------------+ +2 rows in set (0.00 sec) +``` diff --git a/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/log2.md b/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/log2.md new file mode 100644 index 000000000..aae9b0341 --- /dev/null +++ b/docs/MatrixOne/Reference/Functions-and-Operators/Mathematical/log2.md @@ -0,0 +1,35 @@ +# **LOG2()** + +## **Description** + +LOG2(X) returns the base-2 logarithm of X. + +## **Syntax** + +``` +> LOG2(X) +``` + +## **Arguments** + +| Arguments | Description | +|-----------|------------------------------------------------| +| X | Required. Any numeric data type supported now. | + +## **Examples** + +```sql +drop table if exists t1; +create table t1(a float, b float); +insert into t1 values(1024,17.231); +insert into t1 values(4096,23.331); + +mysql>select log2(a),log2(b) from t1; ++---------+-------------------+ +| log2(a) | log2(b) | ++---------+-------------------+ +| 10 | 4.106934600972237 | +| 12 | 4.544176200820541 | ++---------+-------------------+ +2 rows in set (0.01 sec) +``` diff --git a/mkdocs.yml b/mkdocs.yml index 0fefc2d10..fd2bf3be0 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -461,6 +461,8 @@ nav: - FLOOR(): MatrixOne/Reference/Functions-and-Operators/Mathematical/floor.md - LN(): MatrixOne/Reference/Functions-and-Operators/Mathematical/ln.md - LOG(): MatrixOne/Reference/Functions-and-Operators/Mathematical/log.md + - LOG2(): MatrixOne/Reference/Functions-and-Operators/Mathematical/log2.md + - LOG10(): MatrixOne/Reference/Functions-and-Operators/Mathematical/log10.md - PI(): MatrixOne/Reference/Functions-and-Operators/Mathematical/pi.md - POWER(): MatrixOne/Reference/Functions-and-Operators/Mathematical/power.md - RAND(): MatrixOne/Reference/Functions-and-Operators/Mathematical/rand.md