zig/std/math/nan.zig
Andrew Kelley c9fc8bd802 workaround for llvm bug
See #393 for details
2017-06-19 14:36:33 -04:00

12 lines
304 B
Zig

const math = @import("index.zig");
pub const nan = nan_workaround;
pub fn nan_workaround(comptime T: type) -> T {
switch (T) {
f32 => @bitCast(f32, math.nan_u32),
f64 => @bitCast(f64, math.nan_u64),
else => @compileError("nan not implemented for " ++ @typeName(T)),
}
}