Change the implementation of ArrayUtils.range to include the stop value if it is...
[debian/openrocket] / core / src / net / sf / openrocket / util / ArrayUtils.java
index 59290b12d9c8fd48401436ad62bf93dffc2330f4..8f0db53081f6ac14609ab9343e005fe2de66c309 100644 (file)
@@ -6,11 +6,11 @@ public class ArrayUtils {
 
        /**
         * Returns a double array with values from start to end with given step.
-        * Starts exactly at start and stops at the step before stop is reached
+        * Starts exactly at start and stops at the multiple of step <= stop
         */
        public static double[] range(double start, double stop, double step){
                
-               int size = (int) Math.floor(((stop - start) / step));
+               int size = (int) Math.floor(((stop - start) / step)) + 1;
                
                //System.out.println("Range from "+start+" to "+stop+" step "+step+" has length "+size);