docs-v2/content/influxdb/cloud/reference/flux/stdlib/math/abs.md

577 B

title description aliases menu weight
math.abs() function The math.abs() function returns the absolute value of `x`.
/influxdb/cloud/reference/flux/functions/math/abs/
influxdb_cloud_ref
name parent
math.abs Math
301

The math.abs() function returns the absolute value of x.

Output data type: Float

import "math"

math.abs(x: -1.22)

// Returns 1.22

Parameters

x

The value used in the operation.

Data type: Float

Special cases

math.abs(x: ±Inf) // Returns +Inf
math.abs(x: NaN)  // Returns NaN