comparison flys-artifacts/src/main/java/de/intevation/flys/utils/DoubleUtil.java @ 4340:64528d2a89c4

DoubleUtil: New function to find max in an double array.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 31 Oct 2012 14:13:33 +0100
parents 2b4f78ccfbaa
children e8a4d2fd25cc
comparison
equal deleted inserted replaced
4339:ff83ec9b4c0b 4340:64528d2a89c4
197 } 197 }
198 } 198 }
199 } 199 }
200 return true; 200 return true;
201 } 201 }
202
203
204 /** In an array of doubles, search and return the maximum value. */
205 public static final double maxInArray(double[] values) {
206 double max = - Double.MAX_VALUE;
207 for (double d: values) {
208 if (d > max) max = d;
209 }
210 return max;
211 }
202 } 212 }
203 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 213 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org