annotate run/c/cdouble_04_C.d @ 1489:b8c0195059d9

changed nntp: URLs to http: URLs
author thomask
date Mon, 09 Apr 2007 13:47:01 +0000
parents f4e98d870b57
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
744
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
1 // $HeadURL$
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
2 // $Date$
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
3 // $Author$
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
4
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
5 // @author@ Tiago Gasiba <tiago.gasiba@gmail.com>
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
6 // @date@ 2005-11-07
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 1090
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=5344
744
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
8
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
9 module dstress.run.c.cdouble_04_C;
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
10
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
11 void foo(cdouble[] data){
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
12 data[0] /= data.length;
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
13 }
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
14
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
15 int main(){
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
16 cdouble[] data;
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
17 data.length = 2;
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
18 data[0] = 4.0 + 2.0i;
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
19 data[1] = 2.0 + 4.0i;
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
20
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
21 foo(data);
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
22
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
23 assert(data.length == 2);
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
24 assert(data[0].im == 1.0);
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
25 assert(data[0].re == 2.0);
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
26 assert(data[1].im == 4.0);
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
27 assert(data[1].re == 2.0);
1090
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 744
diff changeset
28
744
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
29 return 0;
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
30 }