Here you can find the source of absMax(double[] arr)
Parameter | Description |
---|---|
arr | a parameter |
public static double absMax(double[] arr)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w . ja va 2s . co m*/ * find absolute max value in array * * @param arr * @return */ public static double absMax(double[] arr) { double max = Math.abs(arr[0]); for (int i = 0; i < arr.length; i++) { double val = Math.abs(arr[i]); if (val > max) { max = val; } } return max; } }