Function acos [src]

Alias for std.math.acos.acos

Returns the arc-cosine of x. Special cases: acos(x) = nan if x < -1 or x > 1

Prototype

pub fn acos(x: anytype) @TypeOf(x)

Example

test acos { try expect(acos(@as(f32, 0.0)) == acos32(0.0)); try expect(acos(@as(f64, 0.0)) == acos64(0.0)); }

Source

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)), }; }