Returns the largest value in the array. If array is empty, 0 is returned. @param arr array @return largest value
(double[] arr)
| 166 | * @return largest value |
| 167 | */ |
| 168 | public static double max(double[] arr) { |
| 169 | int i = argMax(arr); |
| 170 | return i < 0 ? 0 : arr[i]; |
| 171 | } |
| 172 | |
| 173 | /** |
| 174 | * Returns the smallest value in the array. If array is empty, 0 is returned. |