acos

Calculates the arc cosine of x, returning a value ranging from 0 to π.

Special Values
xacos(x)invalid?
>1.0NaNyes
<-1.0NaNyes
NaNNaNyes
  1. real acos(real x)
    @safe pure nothrow @nogc
    real
    acos
    (
    real x
    )
  2. double acos(double x)
  3. float acos(float x)

Examples

assert(acos(0.0).approxEqual(1.570));
assert(acos(0.5).approxEqual(std.math.PI / 3));
assert(acos(PI).isNaN);

Meta

Suggestion Box / Bug Report