diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-02-14 13:23:51 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-02-14 13:23:51 +0100 |
commit | 758ff64c69e34965f8af5b2d6ffd65e8d7ab2150 (patch) | |
tree | 6d6b34f8c678862fe9b56c945a7b63f68502c245 /test/ken/cplx4.go | |
parent | 3e45412327a2654a77944249962b3652e6142299 (diff) | |
download | golang-upstream/2011-02-01.1.tar.gz |
Imported Upstream version 2011-02-01.1upstream/2011-02-01.1
Diffstat (limited to 'test/ken/cplx4.go')
-rw-r--r-- | test/ken/cplx4.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ken/cplx4.go b/test/ken/cplx4.go index 3c6f1f68c..8524e47ae 100644 --- a/test/ken/cplx4.go +++ b/test/ken/cplx4.go @@ -15,7 +15,7 @@ const ( C1 = R + I // ADD(5,6) ) -func doprint(c complex) { fmt.Printf("c = %f\n", c) } +func doprint(c complex128) { fmt.Printf("c = %f\n", c) } func main() { @@ -32,12 +32,12 @@ func main() { c2 := complex128(C1) fmt.Printf("c = %G\n", c2) - // real, imag, cmplx - c3 := cmplx(real(c2)+3, imag(c2)-5) + c2 + // real, imag, complex + c3 := complex(real(c2)+3, imag(c2)-5) + c2 fmt.Printf("c = %G\n", c3) // compiler used to crash on nested divide - c4 := cmplx(real(c3/2), imag(c3/2)) + c4 := complex(real(c3/2), imag(c3/2)) if c4 != c3/2 { fmt.Printf("BUG: c3 = %G != c4 = %G\n", c3, c4) } |