Standard library / math
math.Logb()
Binary exponent as float; zero yields -Inf and infinity yields +Inf. Expected stdout: '3\n'.
Formal Syntax & Structure
go syntaxgo
func Logb(x float64) float64Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | float64 | First input operand (or sole input if unary). |
Return Value
float64
Binary exponent as float; zero yields -Inf and infinity yields +Inf.
Working Example
Example Snippetgo
package main
import ( "fmt" "math")
func main() { fmt.Println(math.Logb(8))}