---
title: math.remainder() function
description: math.remainder() returns the IEEE 754 floating-point remainder of x/y.
url: https://docs.influxdata.com/flux/v0/stdlib/math/remainder/
estimated_tokens: 556
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/math/remainder/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.22.0+

InfluxDB support

`math.remainder()` returns the IEEE 754 floating-point remainder of `x/y`.

##### Function type signature

```js
(x: float, y: float) => float
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### x

(Required)
Numerator to use in the operation.

### y

(Required)
Denominator to use in the operation.

## Examples

* [Return the remainder of division between two values](#return-the-remainder-of-division-between-two-values)
* [Use math.remainder in map](#use-mathremainder-in-map)

### Return the remainder of division between two values

```
import "math"

math.remainder(x: 21.0, y: 4.0)// 1.0

```

### Use math.remainder in map

```js
import "math"

data
    |> map(fn: (r) => ({_time: r._time, _value: math.remainder(x: r.t1, y: r.t2)}))
```

[](#view-example-input-and-output)

View example input and output

#### Input data

|       \_time       |  t1  |  t2  |
|--------------------|------|------|
|2021-01-01T00:00:00Z|\-2.18|19.85 |
|2021-01-01T00:00:10Z|10.92 | 4.97 |
|2021-01-01T00:00:20Z| 7.35 |\-3.75|
|2021-01-01T00:00:30Z|17.53 |19.77 |
|2021-01-01T00:00:40Z|15.23 |13.86 |
|2021-01-01T00:00:50Z| 4.43 | 1.86 |

#### Output data

|       \_time       |       \_value       |
|--------------------|---------------------|
|2021-01-01T00:00:00Z|       \-2.18        |
|2021-01-01T00:00:10Z| 0.9800000000000004  |
|2021-01-01T00:00:20Z|\-0.15000000000000036|
|2021-01-01T00:00:30Z|\-2.2399999999999984 |
|2021-01-01T00:00:40Z|  1.370000000000001  |
|2021-01-01T00:00:50Z| 0.7099999999999995  |
| _time | t1 | t2 |
| --- | --- | --- |
| _time | t1 | t2 |
| 2021-01-01T00:00:00Z | -2.18 | 19.85 |
| 2021-01-01T00:00:10Z | 10.92 | 4.97 |
| 2021-01-01T00:00:20Z | 7.35 | -3.75 |
| 2021-01-01T00:00:30Z | 17.53 | 19.77 |
| 2021-01-01T00:00:40Z | 15.23 | 13.86 |
| 2021-01-01T00:00:50Z | 4.43 | 1.86 |

| _time | _value |
| --- | --- |
| _time | _value |
| 2021-01-01T00:00:00Z | -2.18 |
| 2021-01-01T00:00:10Z | 0.9800000000000004 |
| 2021-01-01T00:00:20Z | -0.15000000000000036 |
| 2021-01-01T00:00:30Z | -2.2399999999999984 |
| 2021-01-01T00:00:40Z | 1.370000000000001 |
| 2021-01-01T00:00:50Z | 0.7099999999999995 |
