49
|
1 // based on a report by:
|
|
2 // @author@ Russ Lewis <spamhole-2001-07-16@deming-os.org>
|
|
3 // @date@ 2004-10-11
|
|
4 // @url@ nttp://digitalmars.com/digitalmars.D.bugs:2068
|
|
5 // @uri@ <ckdc4r$re2$1@digitaldaemon.com>
|
|
6
|
|
7 int main(){
|
|
8 double[10] array;
|
|
9 array[0]=double.max;
|
|
10 array[1]=0.875;
|
|
11 array[2]=0.75;
|
|
12 array[3]=0.625;
|
|
13 array[4]=0.5;
|
|
14 array[5]=0.375;
|
|
15 array[6]=0.25;
|
|
16 array[7]=0.125;
|
|
17 array[8]=0.0;
|
|
18 array[9]=double.min;
|
|
19
|
|
20 double[] sorted_copy = array.dup;
|
|
21 sorted_copy.sort;
|
|
22
|
|
23 assert(sorted_copy.length==10);
|
54
|
24 double test = 0;
|
|
25 assert(sorted_copy[0]==test);
|
|
26 test = double.min;
|
|
27 assert(sorted_copy[1]==test);
|
|
28 test = 0.125;
|
|
29 assert(sorted_copy[2]==test);
|
|
30 test = 0.25;
|
|
31 assert(sorted_copy[3]==test);
|
|
32 test = 0.375;
|
|
33 assert(sorted_copy[4]==test);
|
|
34 test = 0.5;
|
|
35 assert(sorted_copy[5]==test);
|
|
36 test = 0.625;
|
|
37 assert(sorted_copy[6]==test);
|
|
38 test = 0.75;
|
|
39 assert(sorted_copy[7]==test);
|
|
40 test = 0.875;
|
|
41 assert(sorted_copy[8]==test);
|
|
42 test = double.max;
|
|
43 assert(sorted_copy[9]==test);
|
49
|
44
|
|
45 return 0;
|
|
46 }
|