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.

generic_fmin

fmin.generic_fmin
inline fn generic_fmin(comptime T: type, x: T, y: T) T

File

lib/compiler_rt/fmin.zig:49

Code

inline fn generic_fmin(comptime T: type, x: T, y: T) T {
    if (math.isNan(x))
        return y;
    if (math.isNan(y))
        return x;
    if (math.signbit(x) != math.signbit(y))
        return if (math.signbit(x)) x else y;
    return if (x < y) x else y;
}