InvalidOperationException | x, y is signaling NaN |
OverflowException | result is too big to be represented |
InexactException | the result is inexact |
x | y | hypot(x, y) |
---|---|---|
±∞ | any | +∞ |
any | ±∞ | +∞ |
NaN | NaN | nan |
NaN | any | nan |
any | NaN | nan |
0.0 | any | y |
any | 0.0 | x |
decimal32 x = 3; decimal32 y = 4; assert (hypot(x, y) == 5);
Calculates the length of the hypotenuse of a right-angled triangle with sides of length x and y. The hypotenuse is the value of the square root of the sums of the squares of x and y.