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

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://documentation.soulver.app/syntax-reference/general/logarithms-and-roots.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
