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.

exp

exp_f128.exp
pub fn exp(x: f128) callconv(.c) f128

File

lib/compiler_rt/exp_f128.zig:29

Code

pub fn exp(x: f128) callconv(.c) f128 {
    if (!math.isFinite(x)) {
        if (math.isNan(x)) {
            if (math.isSignalNan(x)) math.raiseInvalid();
            return math.nan(f128);
        }
        return if (math.signbit(x)) 0 else x;
    }
    if (@abs(x) > 12000) {
        if (math.signbit(x)) {
            math.raiseUnderflow();
            return 0;
        } else {
            math.raiseOverflow();
            return math.inf(f128);
        }
    }

    if (@abs(x) < 0x1p-114)
        return 1 + x;

    return proc1(cfg_e, x);
}