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)
  2. double acos(double x)
  3. float acos(float x)
    @safe pure nothrow @nogc
    float
    acos
    (
    float x
    )

Examples

import std.math.operations : isClose;
import std.math.traits : isNaN;
import std.math.constants : PI;

assert(acos(0.0).isClose(1.570796327));
assert(acos(0.5).isClose(PI / 3));
assert(acos(PI).isNaN);

Meta