Zig 0.17.0-dev (Split by item)

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 library itself.

asin

Returns the arc-sin of x.

Special Cases:

asin.asin
pub fn asin(x: anytype) @TypeOf(x)

File

lib/std/math/asin.zig:26

Code

pub fn asin(x: anytype) @TypeOf(x) {
    const T = @TypeOf(x);
    switch (@typeInfo(T)) {
        .float => |info| switch (info.bits) {
            16 => return asinBinary16(x),
            32 => return asinBinary32(x),
            64 => return asinBinary64(x),
            80 => return asinExtended80(x),
            128 => return asinBinary128(x),
            else => comptime unreachable,
        },
        .vector => |info| switch (info.child) {
            f32 => return asinBinary32Vec(info.len, x),
            f64 => return asinBinary64Vec(info.len, x),
            else => @compileError("unimplemented"),
        },
        else => comptime unreachable,
    }
}