math.nextafter() function

The math.nextafter() function returns the next representable float value after x towards y.

*Output data type: Float*

  1. import "math"
  2. math.nextafter(x: 1.23, y: 4.56)
  3. // Returns 1.2300000000000002

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.nextafter(x:x, y:x) // Returns x
  2. math.nextafter(x: NaN, y:y) // Returns NaN
  3. math.nextafter(x:x, y:NaN) // Returns NaN