Find the maximum value in an array. @param a the array @param indMax the array minimum index @return the maximum value in the array
(double[] a)
| 30 | * @return the maximum value in the array |
| 31 | */ |
| 32 | public static final double max(double[] a) { |
| 33 | double max = Double.NEGATIVE_INFINITY; |
| 34 | for ( int i=0; i<a.length; ++i ) { |
| 35 | if ( a[i] > max ) |
| 36 | { |
| 37 | max = a[i]; |
| 38 | IndexMax = i; |
| 39 | } |
| 40 | } |
| 41 | return max; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Find the minimum value in an array. |
no outgoing calls