Java Math hypot() method with Example
java.lang.Math.hypot() function is an inbuilt math function in Java that returns the Euclidean norm, . The function returns sqrt(x2 + y2) without intermediate overflow or underflow.
- If either argument is infinite, then the result is positive infinity.
- If either argument is NaN and neither argument is infinite, then the result is NaN.
public static double hypot(double x, double y) Parameter : x and y are the values.
sqrt(x2 +y2) without intermediate overflow or underflow.
Example 1 : To show working of java.lang.Math.hyptot() method.
5.0 NaN Infinity
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.