Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 459:fadf797bf123
Increment kms array size by one to take the end of range, too.
flys-artifacts/trunk@1962 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 19 May 2011 14:51:53 +0000 |
parents | 7137ef65c17c |
children | aa64fe4df8ab |
comparison
equal
deleted
inserted
replaced
458:523a256451cd | 459:fadf797bf123 |
---|---|
914 public static double[] getExplodedValues(double from, double to, double step) { | 914 public static double[] getExplodedValues(double from, double to, double step) { |
915 double lower = from; | 915 double lower = from; |
916 | 916 |
917 double diff = to - from; | 917 double diff = to - from; |
918 double tmp = diff / step; | 918 double tmp = diff / step; |
919 int num = (int) Math.ceil(tmp) ; | 919 int num = (int)Math.abs(Math.ceil(tmp)) + 1; |
920 | 920 |
921 double[] values = new double[num]; | 921 double [] values = new double[num]; |
922 | 922 |
923 for (int idx = 0; idx < num; idx++) { | 923 for (int idx = 0; idx < num; idx++) { |
924 values[idx] = lower; | 924 values[idx] = lower; |
925 lower += step; | 925 lower += step; |
926 } | 926 } |