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.

seed48

drand48.seed48
fn seed48(seed16v: *[3]c_ushort) callconv(.c) *[3]c_ushort

File

lib/c/stdlib/drand48.zig:82

Code

fn seed48(seed16v: *[3]c_ushort) callconv(.c) *[3]c_ushort {
    seed48_xi = .{ @truncate(lcg.xi & 0xFFFF), @truncate((lcg.xi >> 16) & 0xFFFF), @truncate((lcg.xi >> 32) & 0xFFFF) };
    const xi = (@as(u48, @as(u16, @truncate(seed16v[0]))) | (@as(u48, @as(u16, @truncate(seed16v[1])))) << 16) | (@as(u48, @as(u16, @truncate(seed16v[2]))) << 32);
    lcg = .init(xi, default_multiplier, default_addend);
    return &seed48_xi;
}