summaryrefslogtreecommitdiff
path: root/test/ken/cplx3.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/ken/cplx3.go')
-rw-r--r--test/ken/cplx3.go23
1 files changed, 21 insertions, 2 deletions
diff --git a/test/ken/cplx3.go b/test/ken/cplx3.go
index fa6ff1d52..048c93eef 100644
--- a/test/ken/cplx3.go
+++ b/test/ken/cplx3.go
@@ -19,10 +19,29 @@ const (
func main() {
c0 := C1
c0 = (c0 + c0 + c0) / (c0 + c0 + 3i)
- println(c0)
+ r, i := real(c0), imag(c0)
+ d := r - 1.292308
+ if d < 0 {
+ d = - d
+ }
+ if d > 1e-6 {
+ println(r, "!= 1.292308")
+ panic(0)
+ }
+ d = i + 0.1384615
+ if d < 0 {
+ d = - d
+ }
+ if d > 1e-6 {
+ println(i, "!= -0.1384615")
+ panic(0)
+ }
c := *(*complex128)(unsafe.Pointer(&c0))
- println(c)
+ if c != c0 {
+ println(c, "!=", c)
+ panic(0)
+ }
var a interface{}
switch c := reflect.ValueOf(a); c.Kind() {