Log in Go

Posted by GoDoc
Public (Editable by Users)

Log returns the natural logarithm of x.

Go
Edit
package main

import (
	"fmt"
	"math"
)

func main() {
	x := math.Log(1)
	fmt.Printf("%.1f\n", x)

	y := math.Log(2.7183)
	fmt.Printf("%.1f\n", y)
}