# Logarithms & Roots

### Square & Cubed Root

| Function | Name        | Behaviour                                    |
| -------- | ----------- | -------------------------------------------- |
| sqrt()   | Square Root | Returns the square root of a number (also √) |
| cbrt()   | Cube Root   | Returns the cube root of a number            |

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

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

### Nth root

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

### Logarithms

| Function       | Name              | Behaviour                                                                                                                 |
| -------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------- |
| exp()          | Exponential       | Calculates the value of e to the power of x, where e is the base of the natural logarithm. exp(1) returns Euler's number. |
| ln()           | Natural logarithm | The natural logarithm of a number is its logarithm to the base of the mathematical constant e.                            |
| log2()         | Base 2 logarithm  | Calculate the base 2 logarithm of a value                                                                                 |
| log(), log10() | Base 10 logarithm | Calculate the base 10 logarithm of a value                                                                                |

### Log to any base

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

You can also use more natural phrases for this operation:

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

### Factorial & Absolute Value

| Function | Name           | Behaviour                                                                     |
| -------- | -------------- | ----------------------------------------------------------------------------- |
| abs()    | Absolute value | Returns the absolute value of a number (i.e makes a negative number positive) |
| fact()   | Factorial      | Returns the factorial of a given number.                                      |


---

# 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/syntax-reference/general/logarithms-and-roots.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.
