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.

testTanSpecial

tan.testTanSpecial
fn testTanSpecial(comptime T: type) !void

File

lib/compiler_rt/tan.zig:190

Code

fn testTanSpecial(comptime T: type) !void {
    const f = switch (T) {
        f32 => tanf,
        f64 => tan,
        f80 => tanx,
        f128 => tanq,
        else => @compileError("unimplemented"),
    };

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