Get the minimum of three double values in Java
Description
The following code shows how to get the minimum of three double values.
Example
/* ww w .j ava 2 s . c o m*/
public class Main {
public static double min(double a, double b, double c) {
return Math.min(Math.min(a, b), c);
}
public static void main(String[] argv){
System.out.println(min(1,2,3));
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »