64
Java Math.hypot() method
The java.lang.Math.hypot() is used to return the square root of the sum of squares of the specified arguments without intermediate overflow or underflow.
Syntax
Parameter
Return
It returns the sqrt(x2 + y2) without intermediate overflow or underflow.
- If the arguments are positive or Negative value, this method will return the Output.
- If either of the argument is positive or negative Infinity, this method will return Positive Infinity.
- If the arguments are NaN and neither argument is infinite, this method will return NaN.
Example 1
Output:
10.0
Example 2
Output:
5.0
Example 3
Output:
Infinity
Example 4
Output:
NaN
Next TopicJava Math