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.

__subvdi3

subvdi3.__subvdi3
pub fn __subvdi3(a: i64, b: i64) callconv(.c) i64

File

lib/compiler_rt/subvdi3.zig:8

Code

pub fn __subvdi3(a: i64, b: i64) callconv(.c) i64 {
    const sum = a -% b;
    // Overflow occurred iff the operands have opposite signs, and the sign of the
    // sum is the opposite of the lhs sign.
    if (((a ^ b) & (sum ^ a)) < 0) @panic("compiler-rt: integer overflow");
    return sum;
}