Computes the Euclidean distance function and complex absolute value.
IEEE Math Library
(libm.a)
System V Math Library (libmsaa.a)
#include <math.h>
double hypot ( x, y)
double x, y;
Computes the square root of (x**2 + y**2) so that underflow does not occur and overflow occurs only if the final result warrants it.
Note: Compile any routine that uses subroutines from the libm.a library with the -lm flag. To compile the hypot.c file, for example:cc hypot.c -lm
x | Specifies some double-precision floating-point value. |
y | Specifies some double-precision floating-point value. |
z | Specifies a structure that has two double elements (z = xi + yj). |
When using the libm.a (-lm) library, if the correct value overflows, the hypot subroutine returns a HUGE_VAL value.
Note: (hypot (INF, value) and hypot (value, INF) are both equal to +INF for all values, even if value = NaN.
When using libmsaa.a (-lmsaa), if the correct value overflows, the hypot subroutine returns HUGE_VAL and sets the global variable errno to ERANGE.
These error-handling procedures may be changed with the matherr subroutine when using the libmsaa.a (-lmsaa) library.
These subroutines are part of Base Operating System (BOS) Runtime.
The matherr (matherr Subroutine) subroutine, sqrt subroutine.
Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.