From b73307befb49dd3b131d99ecf1c7f3fb54578ec8 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 17 May 2018 00:56:14 -0400 Subject: more std lib to postfix deref with zig fmt --- std/math/complex/ldexp.zig | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'std/math/complex/ldexp.zig') diff --git a/std/math/complex/ldexp.zig b/std/math/complex/ldexp.zig index 4fb5a6815f..7ebefff40c 100644 --- a/std/math/complex/ldexp.zig +++ b/std/math/complex/ldexp.zig @@ -15,12 +15,12 @@ pub fn ldexp_cexp(z: var, expt: i32) Complex(@typeOf(z.re)) { } fn frexp_exp32(x: f32, expt: &i32) f32 { - const k = 235; // reduction constant - const kln2 = 162.88958740; // k * ln2 + const k = 235; // reduction constant + const kln2 = 162.88958740; // k * ln2 const exp_x = math.exp(x - kln2); const hx = @bitCast(u32, exp_x); - *expt = i32(hx >> 23) - (0x7f + 127) + k; + expt.* = i32(hx >> 23) - (0x7f + 127) + k; return @bitCast(f32, (hx & 0x7fffff) | ((0x7f + 127) << 23)); } @@ -35,15 +35,12 @@ fn ldexp_cexp32(z: &const Complex(f32), expt: i32) Complex(f32) { const half_expt2 = exptf - half_expt1; const scale2 = @bitCast(f32, (0x7f + half_expt2) << 23); - return Complex(f32).new( - math.cos(z.im) * exp_x * scale1 * scale2, - math.sin(z.im) * exp_x * scale1 * scale2, - ); + return Complex(f32).new(math.cos(z.im) * exp_x * scale1 * scale2, math.sin(z.im) * exp_x * scale1 * scale2); } fn frexp_exp64(x: f64, expt: &i32) f64 { - const k = 1799; // reduction constant - const kln2 = 1246.97177782734161156; // k * ln2 + const k = 1799; // reduction constant + const kln2 = 1246.97177782734161156; // k * ln2 const exp_x = math.exp(x - kln2); @@ -51,7 +48,7 @@ fn frexp_exp64(x: f64, expt: &i32) f64 { const hx = u32(fx >> 32); const lx = @truncate(u32, fx); - *expt = i32(hx >> 20) - (0x3ff + 1023) + k; + expt.* = i32(hx >> 20) - (0x3ff + 1023) + k; const high_word = (hx & 0xfffff) | ((0x3ff + 1023) << 20); return @bitCast(f64, (u64(high_word) << 32) | lx); -- cgit v1.2.3