diff options
author | Robert Griesemer <gri@golang.org> | 2009-12-09 19:27:08 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2009-12-09 19:27:08 -0800 |
commit | 19586282282f5f59c80162c711cd31b94396a87e (patch) | |
tree | 292a7d26be6031010a9b4d9b8e30d160845f9411 /test/chan | |
parent | 4bac20d23b62277fab6e422555c4dda60b648d10 (diff) | |
download | go-19586282282f5f59c80162c711cd31b94396a87e.tar.gz |
making some more non-gofmt'ed files save for new semicolon rule
R=rsc, r
http://codereview.appspot.com/171051
Diffstat (limited to 'test/chan')
-rw-r--r-- | test/chan/powser1.go | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/test/chan/powser1.go b/test/chan/powser1.go index fc8283306..bb36b1594 100644 --- a/test/chan/powser1.go +++ b/test/chan/powser1.go @@ -20,8 +20,11 @@ type rat struct { } func (u rat) pr() { - if u.den==1 { print(u.num) } - else { print(u.num, "/", u.den) } + if u.den==1 { + print(u.num) + } else { + print(u.num, "/", u.den) + } print(" ") } @@ -264,8 +267,7 @@ func inv(u rat) rat { // invert a rat } // print eval in floating point of PS at x=c to n terms -func evaln(c rat, U PS, n int) -{ +func evaln(c rat, U PS, n int) { xn := float64(1); x := float64(c.num)/float64(c.den); val := float64(0); @@ -285,8 +287,11 @@ func printn(U PS, n int) { done := false; for ; !done && n>0; n-- { u := get(U); - if end(u) != 0 { done = true } - else { u.pr() } + if end(u) != 0 { + done = true + } else { + u.pr() + } } print(("\n")); } @@ -344,8 +349,11 @@ func Cmul(c rat,U PS) PS { for !done { <-Z.req; u := get(U); - if end(u) != 0 { done = true } - else { Z.dat <- mul(c,u) } + if end(u) != 0 { + done = true + } else { + Z.dat <- mul(c,u) + } } Z.dat <- finis; }(); @@ -461,8 +469,9 @@ func Diff(U PS) PS { done:=false; for i:=1; !done; i++ { u = get(U); - if end(u) != 0 { done=true } - else { + if end(u) != 0 { + done = true + } else { Z.dat <- mul(itor(int64(i)),u); <-Z.req; } @@ -556,8 +565,11 @@ func Subst(U, V PS) PS { u := get(U); Z.dat <- u; if end(u) == 0 { - if end(get(VV[0])) != 0 { put(finis,Z); } - else { copy(Mul(VV[0],Subst(U,VV[1])),Z); } + if end(get(VV[0])) != 0 { + put(finis,Z); + } else { + copy(Mul(VV[0],Subst(U,VV[1])),Z); + } } }(); return Z; |