DoxigAlpha

acos

Returns the arc-cosine of x.

Special cases:

  • acos(x) = nan if x < -1 or x > 1

Function parameters

Parameters

#
x:anytype

Returns the arc-cosine of x.

Functions

#
acos
Returns the arc-cosine of x.

Source

Implementation

#
pub fn acos(x: anytype) @TypeOf(x) {
    const T = @TypeOf(x);
    return switch (T) {
        f32 => acos32(x),
        f64 => acos64(x),
        else => @compileError("acos not implemented for " ++ @typeName(T)),
    };
}