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

675 B

title description aliases menu weight
math.ilogb() function The math.ilogb() function returns the binary exponent of `x` as an integer.
/influxdb/cloud/reference/flux/functions/math/ilogb/
influxdb_cloud_ref
name parent
math.ilogb Math
301

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

Output data type: Integer

import "math"

math.ilogb(x: 123.45)

// Returns  6.0

Parameters

x

The value used in the operation.

Data type: Float

Special cases

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