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.

testSinSpecial

sin.testSinSpecial
fn testSinSpecial(comptime T: type) !void

File

lib/compiler_rt/sin.zig:199

Code

fn testSinSpecial(comptime T: type) !void {
    const f = switch (T) {
        f32 => sinf,
        f64 => sin,
        f80 => sinx,
        f128 => sinq,
        else => @compileError("unimplemented"),
    };

    try expect(math.isPositiveZero(f(0.0)));
    try expect(math.isNegativeZero(f(-0.0)));
    try expect(math.isNan(f(math.inf(T))));
    try expect(math.isNan(f(-math.inf(T))));
    try expect(math.isNan(f(math.nan(T))));
}