HYPOT intrinsic function

Standard: F77 F90 F95 F2003 F2008 Example program


<Syntax>

HYPOT ( X , Y )

X : Real;
Y : Same type and kind as X, conformable with X;

Result : Same type and kind as X.

<Semantics>

The value of the result is an approximation to the Euclidean distance function of X and Y, mathematically equivalent to SQRT(X**2+Y**2), calculated without undue overflow or underflow. Like many intrinsic functions, this is elemental; if either (or both) of X and Y is an array, the result will be an array with that shape, with the value being computed elementwise.

This function gives exactly the same result as ABS(CMPLX(X,Y,KIND(X))).

<Related>

ABS intrinsic function, SQRT intrinsic function