HYPOT(3) BSD Programmer's Manual HYPOT(3)NAME
hypot, hypotf, cabs, cabsf - euclidean distance and complex absolute val-
ue functions
SYNOPSIS
#include <math.h>
double
hypot(double x, double y);
float
hypotf(float x, float y);
struct {double x, y;} z;
double
cabs(z);
struct {float x, y;} z;
float
cabsf(z);
DESCRIPTION
The hypot(), hypotf(), cabs() and cabsf() functions compute the
sqrt(x*x+y*y) in such a way that underflow will not happen, and overflow
occurs only if the final result deserves it.
hypot(Inf, v) = hypot(v, Inf) = +Inf
for all v, including NaN.
ERRORS
If hypot() or hypotf() overflows, then:
_IEEE_ The return value is +Inf.
_POSIX_ Same as _IEEE_, but errno is also set to ERANGE.
_XOPEN_ Same as _POSIX_, but errno is only set if matherr(3) returns 0.
The exception type is OVERFLOW.
_SVID_ Same as _XOPEN_, but the return value is MAXFLOAT.
SEE ALSOmath(3), sqrt(3)HISTORY
Both a hypot() function and a cabs() function appeared in Version 7 AT&T
UNIX.
4th Berkeley Distribution February 17, 1998 1