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.

expm1

Returns e raised to the power of x, minus 1 (e^x - 1). This is more accurate than exp(e, x) - 1 when x is near 0.

Special Cases:

expm1.expm1
pub fn expm1(x: anytype) @TypeOf(x)

File

lib/std/math/expm1.zig:22

Code

pub fn expm1(x: anytype) @TypeOf(x) {
    const T = @TypeOf(x);
    return switch (T) {
        f32 => expm1_32(x),
        f64 => expm1_64(x),
        else => @compileError("exp1m not implemented for " ++ @typeName(T)),
    };
}