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.

testFloats

signbit.testFloats
fn testFloats(comptime Type: type) !void

File

lib/std/math/signbit.zig:37

Code

fn testFloats(comptime Type: type) !void {
    try expect(!signbit(@as(Type, 0.0)));
    try expect(!signbit(@as(Type, 1.0)));
    try expect(signbit(@as(Type, -2.0)));
    try expect(signbit(@as(Type, -0.0)));
    try expect(!signbit(math.inf(Type)));
    try expect(signbit(-math.inf(Type)));
    try expect(!signbit(math.nan(Type)));
    try expect(signbit(-math.nan(Type)));
}