math.dim() function

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

*Output data type: Float*

  1. import "math"
  2. math.dim(x: 12.2, y: 8.1)
  3. // 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

  1. math.dim(x: +Inf, y: +Inf) // Returns NaN
  2. math.dim(x: -Inf, y: -Inf) // Returns NaN
  3. math.dim(x:x, y : NaN) // Returns NaN
  4. math.dim(x: NaN, y :y) // Returns NaN