From d917815d8111b98dc237cbe2c723fa63018e02b1 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 22 Dec 2017 00:50:30 -0500 Subject: explicitly return from blocks instead of last statement being expression value closes #629 --- std/math/sinh.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'std/math/sinh.zig') diff --git a/std/math/sinh.zig b/std/math/sinh.zig index 32f67a49a8..095dd7ea06 100644 --- a/std/math/sinh.zig +++ b/std/math/sinh.zig @@ -11,11 +11,11 @@ const expo2 = @import("expo2.zig").expo2; pub fn sinh(x: var) -> @typeOf(x) { const T = @typeOf(x); - switch (T) { + return switch (T) { f32 => @inlineCall(sinh32, x), f64 => @inlineCall(sinh64, x), else => @compileError("sinh not implemented for " ++ @typeName(T)), - } + }; } // sinh(x) = (exp(x) - 1 / exp(x)) / 2 @@ -49,7 +49,7 @@ fn sinh32(x: f32) -> f32 { } // |x| > log(FLT_MAX) or nan - 2 * h * expo2(ax) + return 2 * h * expo2(ax); } fn sinh64(x: f64) -> f64 { @@ -83,7 +83,7 @@ fn sinh64(x: f64) -> f64 { } // |x| > log(DBL_MAX) or nan - 2 * h * expo2(ax) + return 2 * h * expo2(ax); } test "math.sinh" { -- cgit v1.2.3