math.ilogb() function

The math.ilogb() function returns the binary exponent of x as an integer.

*Output data type: Integer*

  1. import "math"
  2. math.ilogb(x: 123.45)
  3. // Returns 6.0

Parameters

x

The value used in the operation.

*Data type: Float*

Special cases

  1. math.ilogb(x: ±Inf) // Returns MaxInt32
  2. math.ilogb(x: 0) // Returns MinInt32
  3. math.ilogb(x: NaN) // Returns MaxInt32