Standard library / math

math.Acos()

Inverse cosine in radians, range 0 to pi; outside [-1,1] returns NaN. Expected stdout: '0\n'.

Formal Syntax & Structure

go syntaxgo
func Acos(x float64) float64

Parameters & Attributes

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

Return Value

float64

Inverse cosine in radians, range 0 to pi; outside [-1,1] returns NaN.

Working Example

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