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.

parseCodePageNum

lex.parseCodePageNum
fn parseCodePageNum(str: []const u8) !u32

File

Code

fn parseCodePageNum(str: []const u8) !u32 {
    var x: u32 = 0;
    for (str) |c| {
        const digit = try std.fmt.charToDigit(c, 10);
        if (x != 0) x = try std.math.mul(u32, x, 10);
        x = try std.math.add(u32, x, digit);
    }
    return x;
}