zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

blob b253124c (326B) - Raw


      1 const std = @import("../index.zig");
      2 const math = std.math;
      3 const assert = std.debug.assert;
      4 
      5 pub fn inf(comptime T: type) -> T {
      6     return switch (T) {
      7         f32 => @bitCast(f32, math.inf_u32),
      8         f64 => @bitCast(f64, math.inf_u64),
      9         else => @compileError("inf not implemented for " ++ @typeName(T)),
     10     };
     11 }