1 // $G $D/$F.go && $L $F.$A && ./$A.out
3 // Copyright 2010 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
15 C1 = R + I // ADD(5,6)
18 func doprint(c complex128) { fmt.Printf("c = %f\n", c) }
23 fmt.Printf("c = %f\n", -C1)
28 fmt.Printf("c = %f\n", c1)
33 fmt.Printf("c = %G\n", c2)
35 // real, imag, complex
36 c3 := complex(real(c2)+3, imag(c2)-5) + c2
37 fmt.Printf("c = %G\n", c3)
39 // compiler used to crash on nested divide
40 c4 := complex(real(c3/2), imag(c3/2))
42 fmt.Printf("BUG: c3 = %G != c4 = %G\n", c3, c4)