changeset 206 | b1f279a7ec46 |
parent 187 | e8db9f297016 |
child 209 | 1c999569643b |
1.1 --- a/samples/composition/src-api1.0/api/Arithmetica.java Sat Jun 14 10:01:36 2008 +0200 1.2 +++ b/samples/composition/src-api1.0/api/Arithmetica.java Sat Jun 14 10:04:41 2008 +0200 1.3 @@ -24,6 +24,10 @@ 1.4 1.5 public int sumRange(int from, int to) { 1.6 int len = to - from; 1.7 + if (len < 0) { 1.8 + len = -len; 1.9 + from = to; 1.10 + } 1.11 int[] array = new int[len + 1]; 1.12 for (int i = 0; i <= len; i++) { 1.13 array[i] = from + i;