Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(250)

Unified Diff: src/pkg/big/rat.go

Issue 1453041: code review 1453041: big: bug fix for Quo aliasing problem (Closed)
Patch Set: code review 1453041: big: bug fix for Quo aliasing problem Created 14 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/pkg/big/rat_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/big/rat.go
===================================================================
--- a/src/pkg/big/rat.go
+++ b/src/pkg/big/rat.go
@@ -160,9 +160,11 @@
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()
}
« no previous file with comments | « no previous file | src/pkg/big/rat_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b