changeset 210 | acf2c31e22d4 |
parent 209 | 1c999569643b |
1.1 --- a/samples/composition/src-api1.0/api/Arithmetica.java Sat Jun 14 10:04:51 2008 +0200 1.2 +++ b/samples/composition/src-api1.0/api/Arithmetica.java Sat Jun 14 10:04:53 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;