# 杂项

### 从数字中去除单位或百分比

要从数字中去除单位、比率或百分比，请将其转换为“数字”（或小数）。

```
$100 as number    | 100
40/day to decimal | 40
20% as dec        | 0.2
```

### 比例 / 三项比例法则

这些短语被称为 [三项比例法则](https://en.wikipedia.org/wiki/Cross-multiplication#Rule_of_Three)，可帮助您找到维持比例所需的数字。

```
6 is to 60 as 8 is to what  | 80
5 is to 10 as what is to 80 | 40
```

这些短语也适用于单位：

```
5 km is to 500m as 5 cm is to what                | 5 mm
30 minutes is to 3 hours as what is to 60 seconds | 10 seconds
```

### 比较数字

min() 和 max() 在 Soulver 中

```
larger of 100 and 200  | 200
greater of 100 and 200 | 200
                                                     
smaller of 5 and 10    | 5
lesser of 5 and 10     | 5
```

### 中点

```
half of 175                  | 87.5
midpoint between 150 and 300 | 225
```

### 随机数

要生成指定范围内的随机整数：

```
random number between 1 and 10 | 7
```

要生成随机浮点数，请使用 0 到 1 的范围。

```
random number between 0 and 1 | 0.4793193723
```

### LCM 和 GCD

最小公倍数和最大公约数

```
gcd of 20 and 30 | 10
lcm of 5 and 8   | 40
```

### 排列与组合

```
10 permutation 3 | 720
25 combination 3 | 2,300
```

或者使用稍清晰的语法：

```
3 permutations of 10 | 720
3 combinations of 25 | 2,300
```

### 钳制

```
clamp 26 between 5 and 25 | 25
clamp 4 from 5 to 25      | 5
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.soulver.app/zh/yu-fa-can-kao/general/general.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
