Source file
test/cmplx.go
1
2
3
4
5
6
7
8
9
10 package main
11
12 type (
13 Float32 float32
14 Float64 float64
15 Complex64 complex64
16 Complex128 complex128
17 )
18
19 var (
20 f32 float32
21 f64 float64
22 F32 Float32
23 F64 Float64
24
25 c64 complex64
26 c128 complex128
27 C64 Complex64
28 C128 Complex128
29 )
30
31 func F1() int {
32 return 1
33 }
34
35 func F3() (int, int, int) {
36 return 1, 2, 3
37 }
38
39 func main() {
40
41 c64 = complex(f32, f32)
42 c128 = complex(f64, f64)
43
44 _ = complex128(0)
45 _ = complex(f32, f64)
46 _ = complex(f64, f32)
47 _ = complex(f32, F32)
48 _ = complex(F32, f32)
49 _ = complex(f64, F64)
50 _ = complex(F64, f64)
51
52 _ = complex(F1())
53 _ = complex(F3())
54
55 _ = complex()
56
57 c128 = complex(f32, f32)
58 c64 = complex(f64, f64)
59
60 c64 = complex(1.0, 2.0)
61 c128 = complex(1.0, 2.0)
62 C64 = complex(1.0, 2.0)
63 C128 = complex(1.0, 2.0)
64
65 C64 = complex(f32, f32)
66 C128 = complex(f64, f64)
67
68 }
69
View as plain text