Standard library / math

math.Log()

Natural logarithm; zero yields -Inf, negative finite inputs yield NaN. Expected stdout: '0\n'.

Formal Syntax & Structure

go syntaxgo
func Log(x float64) float64

Parameters & Attributes

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

Return Value

float64

Natural logarithm; zero yields -Inf, negative finite inputs yield NaN.

Working Example

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