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/cplx3.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/cplx3.go')
-rw-r--r-- | test/ken/cplx3.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/test/ken/cplx3.go b/test/ken/cplx3.go index 997894b41..83acc15ff 100644 --- a/test/ken/cplx3.go +++ b/test/ken/cplx3.go @@ -16,24 +16,18 @@ const ( C1 = R + I // ADD(5,6) ) -var complexBits = reflect.Typeof(complex(0i)).Size() * 8 - func main() { c0 := C1 c0 = (c0 + c0 + c0) / (c0 + c0 + 3i) println(c0) - c := *(*complex)(unsafe.Pointer(&c0)) + c := *(*complex128)(unsafe.Pointer(&c0)) println(c) - println(complexBits) - var a interface{} switch c := reflect.NewValue(a).(type) { case *reflect.ComplexValue: - if complexBits == 64 { - v := c.Get() - _, _ = complex64(v), true - } + v := c.Get() + _, _ = complex128(v), true } } |