Skip to content

Commit

Permalink
docs: add new mathematical function
Browse files Browse the repository at this point in the history
Signed-off-by: xmh1011 <[email protected]>
  • Loading branch information
xmh1011 committed Oct 15, 2023
1 parent 173b404 commit 27a1edd
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# **LG()**

## **Description**

LG(X) returns the base-10 logarithm of X.

## **Syntax**

```
> LG(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 lg(a),lg(b) from t1;
+-------------------+--------------------+
| lg(a) | lg(b) |
+-------------------+--------------------+
| 4 | 3.577969368581086 |
| 3.437433443797971 | 2.8339912916439594 |
+-------------------+--------------------+
2 rows in set (0.00 sec)
```
Original file line number Diff line number Diff line change
@@ -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)
```
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,10 @@ nav:
- COT(): MatrixOne/Reference/Functions-and-Operators/Mathematical/cot.md
- EXP(): MatrixOne/Reference/Functions-and-Operators/Mathematical/exp.md
- FLOOR(): MatrixOne/Reference/Functions-and-Operators/Mathematical/floor.md
- LG(): MatrixOne/Reference/Functions-and-Operators/Mathematical/lg.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
- 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
Expand Down

0 comments on commit 27a1edd

Please sign in to comment.