# $divide

`$divide` operator lets you **divide** one value from another and return the result of the expression. You can use this in any [**Expression Object**](/flow-builder/cql-cosmocloud-query-language/building-expressions.md).

## Syntax

```json
{
    "$divide": [<val_1>, <val_2>]
}
```

### Properties

| Field     | Description                                                                                                                                                                                                                                                                                                     | Required |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| \<val\_1> | <p>The value to be divided, also known as the dividend.<br><br>The <code>\<val\_1></code> can be any valid <a href="/pages/E96SHGHwhXp256hQZFJ6"><mark style="color:blue;"><strong>expression</strong></mark></a> as long as it resolves to a number.</p><p></p><p>It can also be a Magical Autocomplete.</p>   | true     |
| \<val\_2> | <p>The value to be divided by, also known as the divisor.<br><br>The <code>\<val\_2></code> can be any valid <a href="/pages/E96SHGHwhXp256hQZFJ6"><mark style="color:blue;"><strong>expression</strong></mark></a> as long as it resolves to a number.</p><p></p><p>It can also be a Magical Autocomplete.</p> | true     |

### Returns

`float` - The result of $divide operation

## Examples

### Basic example

```json
{
    "$divide": [10, 2]
}
```

The above expression returns **5.0**

### With Nested Expressions

```json
{
    "$divide": [
        {
            "$add": [1, 2]
        },
        4
    ]
}
```

The above expression calculates the nested expression, return **3** in its place and then the outer `$divide` expression returns **0.75** overall.

### With Magical Autocomplete

Let's say we have declared a variable `temp` in our API flow, which has a value of **6** currently.

```json
{
    "$divide": ["$.variables.temp", 3]
}
```

The above expression would resolve to a result of **2.0**


---

# 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://docs.cosmocloud.io/flow-builder/cql-cosmocloud-query-language/building-expressions/usddivide.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.
