# TLO:Math

## Description

Creates a Math object which gives allows access to the math type members.

## Forms

* [*math*](/macroquest/data-types-and-top-level-objects/data-types/datatype-math.md) **Math**

## Access to Types

* [*math*](/macroquest/data-types-and-top-level-objects/data-types/datatype-math.md) **math**

## Examples

`/echo ${Math.Calc[3-1]}`

Echoes 2.00

`/echo ${Math.Calc[49%6+25]}`

Echoes the result of 49 modulo 6 + 25, or 1 + 25

`/echo ${Math.Sqrt[49]}`

Echoes the square root of 49

`/echo ${Math.Rand[500]}`

Echoes a random number between 1 and 500

Math.Rand now takes an optional min argument so you can get a random number between 2 variables.

`/echo ${Math.Rand[5,10]}`

this would return a randum number between 5 and 10.

## See Also

* [Top-Level Objects](/macroquest/data-types-and-top-level-objects/top-level-objects.md)
* [DataType:Math](/macroquest/data-types-and-top-level-objects/data-types/datatype-math.md)


---

# 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://macroquest.gitbook.io/macroquest/data-types-and-top-level-objects/top-level-objects/tlo-math.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.
