Log2 in Go

Posted by GoDoc
Public (Editable by Users)

Log2 returns the binary logarithm of x. The special cases are the same as for Log.

Go
Edit
package main

import (
	"fmt"
	"math"
)

func main() {
	fmt.Printf("%.1f", math.Log2(256))
}