﻿---
title: Arithmetic operators
description: PromQL arithmetic operators in Elasticsearch.
url: https://docs-v3-preview.elastic.dev/elastic/elasticsearch/tree/main/reference/query-languages/promql/operators/arithmetic
products:
  - Elasticsearch
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Preview in 9.4
---

# Arithmetic operators
These binary operators perform arithmetic between scalars and instant vectors. For vector–vector operations, the metric name is dropped from the result.

## `+` (add)

<applies-to>Elastic Stack: Preview in 9.4</applies-to>
Adds the two operands element-wise. For vector–vector operations, the metric name is dropped.
**Operands**
<definitions>
  <definition term="lhs, rhs (instant_vector or scalar)">
    The left and right operands. When one side is a scalar, the operator applies between the scalar and each sample of the vector.
  </definition>
</definitions>

**Returns**
An `instant_vector`, or a `scalar` when both operands are scalars.
**Example**
```
requests_total + requests_errors
```


## `/` (div)

<applies-to>Elastic Stack: Preview in 9.4</applies-to>
Divides the left operand by the right operand element-wise. For vector–vector operations, the metric name is dropped.
**Operands**
<definitions>
  <definition term="lhs, rhs (instant_vector or scalar)">
    The left and right operands. When one side is a scalar, the operator applies between the scalar and each sample of the vector.
  </definition>
</definitions>

**Returns**
An `instant_vector`, or a `scalar` when both operands are scalars.
**Example**
```
requests_errors / requests_total
```


## `%` (mod)

<applies-to>Elastic Stack: Preview in 9.4</applies-to>
Returns the remainder of dividing the left operand by the right operand element-wise. For vector–vector operations, the metric name is dropped.
**Operands**
<definitions>
  <definition term="lhs, rhs (instant_vector or scalar)">
    The left and right operands. When one side is a scalar, the operator applies between the scalar and each sample of the vector.
  </definition>
</definitions>

**Returns**
An `instant_vector`, or a `scalar` when both operands are scalars.
**Example**
```
metric % 10
```


## `*` (mul)

<applies-to>Elastic Stack: Preview in 9.4</applies-to>
Multiplies the two operands element-wise. For vector–vector operations, the metric name is dropped.
**Operands**
<definitions>
  <definition term="lhs, rhs (instant_vector or scalar)">
    The left and right operands. When one side is a scalar, the operator applies between the scalar and each sample of the vector.
  </definition>
</definitions>

**Returns**
An `instant_vector`, or a `scalar` when both operands are scalars.
**Example**
```
100 * rate(requests_total[5m])
```


## `^` (pow)

<applies-to>Elastic Stack: Preview in 9.4</applies-to>
Raises the left operand to the power of the right operand element-wise. For vector–vector operations, the metric name is dropped.
**Operands**
<definitions>
  <definition term="lhs, rhs (instant_vector or scalar)">
    The left and right operands. When one side is a scalar, the operator applies between the scalar and each sample of the vector.
  </definition>
</definitions>

**Returns**
An `instant_vector`, or a `scalar` when both operands are scalars.
**Example**
```
metric ^ 2
```


## `-` (sub)

<applies-to>Elastic Stack: Preview in 9.4</applies-to>
Subtracts the right operand from the left operand element-wise. For vector–vector operations, the metric name is dropped.
**Operands**
<definitions>
  <definition term="lhs, rhs (instant_vector or scalar)">
    The left and right operands. When one side is a scalar, the operator applies between the scalar and each sample of the vector.
  </definition>
</definitions>

**Returns**
An `instant_vector`, or a `scalar` when both operands are scalars.
**Example**
```
requests_total - requests_errors
```