content/flux/v0/stdlib/math/mmax.md
math.mMax() returns the larger of x or y.
(x: float, y: float) => float
{{% caption %}} For more information, see Function type signatures. {{% /caption %}}
({{< req >}}) x-value to use in the operation.
({{< req >}}) y-value to use in the operation.
import "math"
math.mMax(x: 1.23, y: 4.56)// 4.56
import "math"
data
|> map(fn: (r) => ({_time: r._time, _value: math.mMax(x: r.t1, y: r.t2)}))
{{< expand-wrapper >}} {{% expand "View example input and output" %}}
| _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 |
|---|---|
| 2021-01-01T00:00:00Z | 19.85 |
| 2021-01-01T00:00:10Z | 10.92 |
| 2021-01-01T00:00:20Z | 7.35 |
| 2021-01-01T00:00:30Z | 19.77 |
| 2021-01-01T00:00:40Z | 15.23 |
| 2021-01-01T00:00:50Z | 4.43 |
{{% /expand %}} {{< /expand-wrapper >}}