Here you can find the source of maximum(double[] list)
Parameter | Description |
---|---|
list | a parameter |
public static double maximum(double[] list)
//package com.java2s; //License from project: Open Source License public class Main { /**/* ww w .j ava 2 s. c om*/ * Returns the maximum double in the list of doubles. Assumes that * list is not null. * @param list * @return */ public static double maximum(double[] list) { double max = list[0]; for (int i = 1; i < list.length; ++i) if (list[i] > max) max = list[i]; return max; } /** * Returns the maximum int in the list of ints. Assumes that * list is not null. * @param list * @return */ public static int maximum(int[] list) { int max = list[0]; for (int i = 1; i < list.length; ++i) if (list[i] > max) max = list[i]; return max; } }