2017-12-24 11:08:53 +08:00
|
|
|
const std = @import("../index.zig");
|
|
|
|
const math = std.math;
|
2017-06-16 16:26:10 +08:00
|
|
|
|
2018-01-25 17:10:11 +08:00
|
|
|
pub fn inf(comptime T: type) T {
|
2017-12-22 13:50:30 +08:00
|
|
|
return switch (T) {
|
2018-06-30 07:44:54 +08:00
|
|
|
f16 => @bitCast(f16, math.inf_u16),
|
2017-06-16 16:26:10 +08:00
|
|
|
f32 => @bitCast(f32, math.inf_u32),
|
|
|
|
f64 => @bitCast(f64, math.inf_u64),
|
|
|
|
else => @compileError("inf not implemented for " ++ @typeName(T)),
|
2017-12-22 13:50:30 +08:00
|
|
|
};
|
2017-06-16 16:26:10 +08:00
|
|
|
}
|