> For the complete documentation index, see [llms.txt](https://documentation.soulver.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.soulver.app/zh/yu-fa-can-kao/general/logarithms-and-roots.md).

# 对数与根式

### 平方根和立方根

| Function | Name        | Behaviour               |
| -------- | ----------- | ----------------------- |
| sqrt()   | Square Root | 返回一个数的平方根（也即 $\sqrt{}$） |
| cbrt()   | Cube Root   | 返回一个数的立方根               |

```
sqrt(16)          | 4
cbrt(343)         | 7

square root of 81 | 9
cube root of 27   | 3
```

### N次方根

```
root 5 of 100 | 2.5118864315
```

### 对数

| Function       | Name              | Behaviour                                     |
| -------------- | ----------------- | --------------------------------------------- |
| exp()          | Exponential       | 计算 $e$ 的 $x$ 次方，其中 $e$ 是自然对数的底数。exp(1) 返回欧拉数。 |
| ln()           | Natural logarithm | 一个数的自然对数是其以数学常数 $e$ 为底的对数。                    |
| log2()         | Base 2 logarithm  | 计算一个值的以 2 为底的对数                               |
| log(), log10() | Base 10 logarithm | 计算一个值的以 10 为底的对数                              |

### 任意底数的对数

```
log 20 base 4 | 2.1609640474
```

您也可以使用更自然的短语来表示此操作：

```
81 is 9 to what power | 2
27 is 3 to the what power | 3
```

### 阶乘和绝对值

| Function | Name           | Behaviour           |
| -------- | -------------- | ------------------- |
| abs()    | Absolute value | 返回一个数的绝对值（即使负数变为正数） |
| fact()   | Factorial      | 返回给定数的阶乘。           |
