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.

subborrowxU64

The function subborrowxU64 is a subtraction with borrow.

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

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

secp256k1_64.subborrowxU64
fn subborrowxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) void

File

Code

fn subborrowxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) void {
    const x = @as(u128, arg2) -% arg3 -% arg1;
    out1.* = @truncate(x);
    out2.* = @truncate(x >> 64);
}