Standard library / math

math.Ilogb()

Binary exponent as an integer; special sentinel values for zero, infinities and NaN. Expected stdout: '3\n'.

Formal Syntax & Structure

go syntaxgo
func Ilogb(x float64) int

Parameters & Attributes

NameTypeDescription
xfloat64First input operand (or sole input if unary).

Return Value

int

Binary exponent as an integer; special sentinel values for zero, infinities and NaN.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math")
func main() {  fmt.Println(math.Ilogb(8))}
Go Reference