Clicky

Fortran Wiki
hypot

Description

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

Standard

Fortran 2008 and later

Class

Elemental function

Syntax

result = hypot(x, y)

Arguments

  • x - The type shall be real.
  • y - The 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

category: intrinsics