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.

add_adjusted

fma.add_adjusted
fn add_adjusted(a: f64, b: f64) f64

File

lib/compiler_rt/fma.zig:196

Code

fn add_adjusted(a: f64, b: f64) f64 {
    var sum = dd_add(a, b);
    if (sum.lo != 0) {
        var uhii: u64 = @bitCast(sum.hi);
        if (uhii & 1 == 0) {
            // hibits += copysign(1.0, sum.hi, sum.lo)
            const uloi: u64 = @bitCast(sum.lo);
            uhii = uhii + 1 - ((uhii ^ uloi) >> 62);
            sum.hi = @bitCast(uhii);
        }
    }
    return sum.hi;
}