summaryrefslogtreecommitdiff
path: root/src/pkg/big/rat.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/big/rat.go')
-rw-r--r--src/pkg/big/rat.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pkg/big/rat.go b/src/pkg/big/rat.go
index f35df4b46..ddd858d5c 100644
--- a/src/pkg/big/rat.go
+++ b/src/pkg/big/rat.go
@@ -160,9 +160,11 @@ func (z *Rat) Quo(x, y *Rat) *Rat {
if len(y.a.abs) == 0 {
panic("division by zero")
}
- z.a.abs = z.a.abs.mul(x.a.abs, y.b)
- z.b = z.b.mul(x.b, y.a.abs)
- z.a.neg = x.a.neg != y.a.neg
+ a := mulNat(&x.a, y.b)
+ b := mulNat(&y.a, x.b)
+ z.a.abs = a.abs
+ z.b = b.abs
+ z.a.neg = a.neg != b.neg
return z.norm()
}