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.

mulxU64

The function mulxU64 is a multiplication, returning the full double-width result.

Postconditions: out1 = (arg1 * arg2) mod 2^64 out2 = ⌊arg1 * arg2 / 2^64⌋

Input Bounds: arg1: [0x0 ~> 0xffffffffffffffff] arg2: [0x0 ~> 0xffffffffffffffff] Output Bounds: out1: [0x0 ~> 0xffffffffffffffff] out2: [0x0 ~> 0xffffffffffffffff]

p384_64.mulxU64
fn mulxU64(out1: *u64, out2: *u64, arg1: u64, arg2: u64) void

File

Code

fn mulxU64(out1: *u64, out2: *u64, arg1: u64, arg2: u64) void {
    @setRuntimeSafety(mode == .debug);

    const x = @as(u128, arg1) * @as(u128, arg2);
    out1.* = @as(u64, @truncate(x));
    out2.* = @as(u64, @truncate(x >> 64));
}