aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math/inf.zig
blob: fd7d7c4380cd53c2d28d2be498d3778a592e7c86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const std = @import("../std.zig");
const math = std.math;

/// Returns value inf for the type T.
pub fn inf(comptime T: type) T {
    return switch (T) {
        f16 => math.inf_f16,
        f32 => math.inf_f32,
        f64 => math.inf_f64,
        f80 => math.inf_f80,
        f128 => math.inf_f128,
        else => @compileError("inf not implemented for " ++ @typeName(T)),
    };
}