docs-v2/content/v2.0/reference/flux/functions/math/dim.md

681 B

title description menu weight
math.dim() function The math.dim() function returns the maximum of `x`-`y` or 0.
v2_0_ref
name parent
math.dim Math
301

The math.dim() function returns the maximum of x - y or 0.

Output data type: Float

import "math"

math.dim(x: 12.2, y: 8.1)

// Returns 4.1

Parameters

x

The X value used in the operation.

Data type: Float

y

The Y value used in the operation.

Data type: Float

Special cases

math.dim(x: +Inf, y: +Inf) // Returns NaN
math.dim(x: -Inf, y: -Inf) // Returns NaN
math.dim(x:x, y    : NaN)  // Returns NaN
math.dim(x: NaN, y :y)     // Returns NaN