comparison test/complex1.d @ 104:4d1e9eb001e0 trunk

[svn r108] Now basic suppport for complex types. =,+,-,*,/ are supported.
author lindquist
date Mon, 19 Nov 2007 02:58:58 +0100
parents 16e88334bba7
children
comparison
equal deleted inserted replaced
103:855adfdb8d38 104:4d1e9eb001e0
1 module complex1; 1 module complex1;
2 2
3 void main() 3 void main()
4 { 4 {
5 cfloat c1; 5 cfloat cf1 = 3f + 0i;
6 cfloat cf2 = 4f + 1i;
7 cfloat cf3 = func();
8 auto c1 = cf1 + cf2;
9 auto c2 = cf2 - cf3;
10 {
11 auto c3 = cf1 * cf3;
12 {
13 auto c4 = cf2 / cf3;
14 }
15 }
6 } 16 }
17
18 cfloat func()
19 {
20 return 3f + 1i;
21 }