Math module

acos

procedure · 2 overloadsSource

The arc cosine in radians, in [0, pi]. float and float64. An argument outside [-1, 1] gives NaN.

ExampleOpen in playground ↗
assert(acos(cast(float64) 1) == 0);
assert(abs(acos(cast(float64) -1) - PI64) < 0.000001);
assert(isnan(acos(cast(float64) 2)));
acos :: (x: float64) -> float64

Arccosine, in radians between 0 and pi.

Parameters

x: float64
the value. Outside -1..1 gives NaN.

Returns

float64
acos :: (theta: float) -> float

Arccosine, in radians between 0 and pi.

Parameters

theta: float
the value. Outside -1..1 gives NaN.

Returns

float

See also