Log2 returns the binary logarithm of x. The special cases are the same as for Log.
package main import ( "fmt" "math" ) func main() { fmt.Printf("%.1f", math.Log2(256)) }