Next: , Previous: , Up: Intrinsic Procedures   [Contents][Index]


9.133 HYPOT — Euclidean distance function

Description:

HYPOT(X,Y) is the Euclidean distance function. It is equal to \sqrt{X^2 + Y^2}, without undue underflow or overflow.

Standard:

Fortran 2008 and later

Class:

Elemental function

Syntax:

RESULT = HYPOT(X, Y)

Arguments:
XThe type shall be REAL.
YThe type and kind type parameter shall be the same as X.
Return value:

The return value has the same type and kind type parameter as X.

Example:
program test_hypot
  real(4) :: x = 1.e0_4, y = 0.5e0_4
  x = hypot(x,y)
end program test_hypot