StrictMath.max(double, double): This method is available in java.lang.StrictMath class of Java.
Syntax:
double java.lang.StrictMath.max(double a, double b)
This method takes two arguments of type double as its parameters. This method returns the greater of two double values. That is, the result is the argument closer to positive infinity.
Note:
1. If the arguments have the same value, the result is the same value.
2. If either value is NaN, then the result is NaN.
Parameters: Two parameters are required for this method.
a: an argument.
b: another argument.
Returns: the larger of a and b.
Exceptions: NA
Approach
Java
public class StrictMathmaxdouble {public static void main(String[] args) {double a = 178.89;double b = 1991;System.out.println(StrictMath.max(a, b));}}
Output:
1991.0
Some more max() Methods of StrictMath class
No comments:
Post a Comment