X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=core%2Fsrc%2Fnet%2Fsf%2Fopenrocket%2Futil%2FArrayUtils.java;h=8f0db53081f6ac14609ab9343e005fe2de66c309;hb=9e426c00e4a50f6524d7ea0908ab92cf230b7ea2;hp=8e504a55e7ea37abe45c114eef7002367b51b28b;hpb=78f89d7f5527bb6d4077deb98bd51c10b79ade4e;p=debian%2Fopenrocket diff --git a/core/src/net/sf/openrocket/util/ArrayUtils.java b/core/src/net/sf/openrocket/util/ArrayUtils.java index 8e504a55..8f0db530 100644 --- a/core/src/net/sf/openrocket/util/ArrayUtils.java +++ b/core/src/net/sf/openrocket/util/ArrayUtils.java @@ -6,16 +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 = 0 ; - if ( stop <= start ) { - size = 0; - } else { - size = (int) Math.ceil(((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);