> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metrics-man.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Divide

# \$divide

The `$divide` operator divides the first numeric value by the second numeric value.

## Input

* An array containing exactly two numeric values (dividend and divisor)

## Output

* The quotient of the two input values (first / second)

## Examples

### Basic Division

```json theme={null}
{
  "$divide": [
    20,
    4
  ]
}
```

Result: `5.0`

### Field Value Division

```json theme={null}
{
  "$divide": [
    {
      "$input": "total_sales"
    },
    {
      "$input": "number_of_customers"
    }
  ]
}
```

Result: The average sales per customer

### Decimal Division

```json theme={null}
{
  "$divide": [
    10.5,
    2
  ]
}
```

Result: `5.25`

### Division by Zero Error

```json theme={null}
{
  "$divide": [
    10,
    0
  ]
}
```

Result: Error (division by zero)
