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/log10.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/log10.zig')
| -rw-r--r-- | std/math/log10.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/std/math/log10.zig b/std/math/log10.zig index 75e1203ad4..73168dec8d 100644 --- a/std/math/log10.zig +++ b/std/math/log10.zig @@ -14,7 +14,7 @@ pub fn log10(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (@typeId(T)) { TypeId.FloatLiteral => { - return @typeOf(1.0)(log10_64(x)) + return @typeOf(1.0)(log10_64(x)); }, TypeId.Float => { return switch (T) { @@ -90,7 +90,7 @@ pub fn log10_32(x_: f32) -> f32 { const lo = f - hi - hfsq + s * (hfsq + R); const dk = f32(k); - dk * log10_2lo + (lo + hi) * ivln10lo + lo * ivln10hi + hi * ivln10hi + dk * log10_2hi + return dk * log10_2lo + (lo + hi) * ivln10lo + lo * ivln10hi + hi * ivln10hi + dk * log10_2hi; } pub fn log10_64(x_: f64) -> f64 { @@ -124,7 +124,7 @@ pub fn log10_64(x_: f64) -> f64 { // subnormal, scale x k -= 54; x *= 0x1.0p54; - hx = u32(@bitCast(u64, x) >> 32) + hx = u32(@bitCast(u64, x) >> 32); } else if (hx >= 0x7FF00000) { return x; @@ -167,7 +167,7 @@ pub fn log10_64(x_: f64) -> f64 { val_lo += (y - ww) + val_hi; val_hi = ww; - val_lo + val_hi + return val_lo + val_hi; } test "math.log10" { |
