Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

acos

Public Function
std.math.acos.acos
pub fn acos(x: anytype) @TypeOf(x)

Returns the arc-cosine of x.

Special cases:

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

Params

  • x

File

math/acos.zig:24
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
pub fn acos(x: anytype) @TypeOf(x) {
    const T = @TypeOf(x);
    switch (@typeInfo(T)) {
        .float => |info| switch (info.bits) {
            16 => return acosBinary16(x),
            32 => return acosBinary32(x),
            64 => return acosBinary64(x),
            80 => return acosExtended80(x),
            128 => return acosBinary128(x),
            else => comptime unreachable,
        },
        .vector => |info| switch (info.child) {
            f32 => return acosBinary32Vec(info.len, x),
            f64 => return acosBinary64Vec(info.len, x),
            else => @compileError("unimplemented"),
        },
        else => comptime unreachable,
    }
}