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.

dd_add128

Compute a+b exactly, returning the exact result in a struct dd. We assume that both a and b are finite, but make no assumptions about their relative magnitudes.

fma.dd_add128
fn dd_add128(a: f128, b: f128) dd128

File

lib/compiler_rt/fma.zig:235

Code

fn dd_add128(a: f128, b: f128) dd128 {
    var ret: dd128 = undefined;
    ret.hi = a + b;
    const s = ret.hi - a;
    ret.lo = (a - (ret.hi - s)) + (b - s);
    return ret;
}