summaryrefslogtreecommitdiff
path: root/src/pkg/bignum/nrdiv_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/bignum/nrdiv_test.go')
-rw-r--r--src/pkg/bignum/nrdiv_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/bignum/nrdiv_test.go b/src/pkg/bignum/nrdiv_test.go
index 752ab7903..724eecec3 100644
--- a/src/pkg/bignum/nrdiv_test.go
+++ b/src/pkg/bignum/nrdiv_test.go
@@ -95,13 +95,13 @@ func nrDivEst(x0, y0 Natural) Natural {
// Determine a scale factor f = 2^e such that
// 0.5 <= y/f == y*(2^-e) < 1.0
// and scale y accordingly.
- e := int(y.m.Log2())+1;
+ e := int(y.m.Log2()) + 1;
y.e -= e;
// t1
var c = 2.9142;
const n = 14;
- t1 := fpNat{Nat(uint64(c*(1<<n))), -n};
+ t1 := fpNat{Nat(uint64(c * (1 << n))), -n};
// Compute initial value r0 for the reciprocal of y/f.
// r0 = t1 - 2*y
@@ -129,7 +129,7 @@ func nrDivEst(x0, y0 Natural) Natural {
// reduce mantissa size
// TODO: Find smaller bound as it will reduce
// computation time massively.
- d := int(r.m.Log2() + 1)-maxLen;
+ d := int(r.m.Log2()+1) - maxLen;
if d > 0 {
r = fpNat{r.m.Shr(uint(d)), r.e + d}
}