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