X: It can be a double value or a valid numerical expression which represent Cartesian X – Coordinate.

Y: It can be a double value or a valid numerical expression which represent Cartesian Y – Coordinate.

Return Value: Java hypot function will return sqrt(x² + y²) as a output but there there some special cases where the output will change:

If the number argument is positive integer and Negative integer, Math.hypot function will return the Output.

If either of the arguments is infinite then the result of this Math.hypot function will be positive infinite.

When the arguments are not a number or infinite, Java Math.hypot function will return NaN.

Java hypot Function Example

The Java Math.hypot function is used to find the square root of the sum of squares of a given number. In this Java program, We are going to find the same with both positive and negative values and display the output.