summaryrefslogtreecommitdiff
path: root/test/ken/cplx5.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-01-19 23:09:00 -0500
committerRuss Cox <rsc@golang.org>2011-01-19 23:09:00 -0500
commited3592f95664c555d787d87b28ff783b846257e6 (patch)
tree9bfdc7720f6c491c1c293a4bd367abec2a1221f4 /test/ken/cplx5.go
parent8d36be6d5ae904467a0be5e7dc3965581a3dbf73 (diff)
downloadgo-ed3592f95664c555d787d87b28ff783b846257e6.tar.gz
delete float, complex - code changes
also: cmplx -> complex float64(1.0) -> 1.0 float64(1) -> 1.0 R=gri, r, gri1, r2 CC=golang-dev http://codereview.appspot.com/3991043
Diffstat (limited to 'test/ken/cplx5.go')
-rw-r--r--test/ken/cplx5.go32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/ken/cplx5.go b/test/ken/cplx5.go
index af2a1c57d..d425a7c4c 100644
--- a/test/ken/cplx5.go
+++ b/test/ken/cplx5.go
@@ -6,49 +6,49 @@
package main
-var a [12]complex
-var s []complex
-var c chan complex
+var a [12]complex128
+var s []complex128
+var c chan complex128
var f struct {
- c complex
+ c complex128
}
-var m map[complex]complex
+var m map[complex128]complex128
func main() {
- // array of complex
+ // array of complex128
for i := 0; i < len(a); i++ {
- a[i] = cmplx(float(i), float(-i))
+ a[i] = complex(float64(i), float64(-i))
}
println(a[5])
- // slice of complex
- s = make([]complex, len(a))
+ // slice of complex128
+ s = make([]complex128, len(a))
for i := 0; i < len(s); i++ {
s[i] = a[i]
}
println(s[5])
// chan
- c = make(chan complex)
+ c = make(chan complex128)
go chantest(c)
println(<-c)
- // pointer of complex
+ // pointer of complex128
v := a[5]
pv := &v
println(*pv)
- // field of complex
+ // field of complex128
f.c = a[5]
println(f.c)
- // map of complex
- m = make(map[complex]complex)
+ // map of complex128
+ m = make(map[complex128]complex128)
for i := 0; i < len(s); i++ {
m[-a[i]] = a[i]
}
println(m[5i-5])
- println(m[cmplx(-5, 5)])
+ println(m[complex(-5, 5)])
}
-func chantest(c chan complex) { c <- a[5] }
+func chantest(c chan complex128) { c <- a[5] }