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. Private Type Function
SignOf
Private Type Function
std.math.SignOf
fnSignOf(T: type) type
File
math.zig:1765
176517661767176817691770177117721773
fnSignOf(T: type) type {
returnswitch (@typeInfo(T)) {
.comptime_int, .comptime_float => comptime_int,
.int => IntFittingRange(@max(minInt(T), -1), @min(maxInt(T), 1)),
.float => IntFittingRange(-1, 1),
.vector => |vec| @Vector(vec.len, SignOf(vec.child)),
else => @compileError("Expected an int, float, or a vector of one, found " ++ @typeName(T)),
};
}