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 subroutine, sqrt subroutine.
Subroutines Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.