diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-12-22 00:50:30 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-12-22 00:50:30 -0500 |
| commit | d917815d8111b98dc237cbe2c723fa63018e02b1 (patch) | |
| tree | ce12771a86b2412ee9692ca73d3ca49abe5da3ce /std/math/nan.zig | |
| parent | 8bc523219c66427951e5339550502871547f2138 (diff) | |
| download | zig-d917815d8111b98dc237cbe2c723fa63018e02b1.tar.gz zig-d917815d8111b98dc237cbe2c723fa63018e02b1.zip | |
explicitly return from blocks
instead of last statement being expression value
closes #629
Diffstat (limited to 'std/math/nan.zig')
| -rw-r--r-- | std/math/nan.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/std/math/nan.zig b/std/math/nan.zig index a4899d6b82..e92bb04cb9 100644 --- a/std/math/nan.zig +++ b/std/math/nan.zig @@ -1,19 +1,19 @@ const math = @import("index.zig"); pub fn nan(comptime T: type) -> T { - switch (T) { + return switch (T) { f32 => @bitCast(f32, math.nan_u32), f64 => @bitCast(f64, math.nan_u64), else => @compileError("nan not implemented for " ++ @typeName(T)), - } + }; } // Note: A signalling nan is identical to a standard right now by may have a different bit // representation in the future when required. pub fn snan(comptime T: type) -> T { - switch (T) { + return switch (T) { f32 => @bitCast(f32, math.nan_u32), f64 => @bitCast(f64, math.nan_u64), else => @compileError("snan not implemented for " ++ @typeName(T)), - } + }; } |
