NAME

hypot, cabs - Euclidean distance, complex absolute value

SYNOPSIS

#include <math.h>

double hypot(x,y)

double x,y;

double cabs(z)

struct {double x,y;} z;

DESCRIPTION

Hypot(x,y) and cabs(x,y) return sqrt(x*x+y*y) computed in
such a

way that underflow will not happen, and overflow occurs only
if the

final result deserves it.

hypot(infinity,v) =
hypot(v,infinity) = +infinity for all v,

including NaN.

NOTES

As might be expected, hypot(v,NaN) and hypot(NaN,v) are NaN
for all

finite v. But programmers on machines other than a VAX might
be

surprised at first to discover that hypot(+-infinity,NaN) =

+infinity. This is intentional; it happens because

hypot(infinity,v) = +infinity for all v, finite or infinite.
Hence

hypot(infinity,v) is independent of v. The IEEE NaN is
designed to

disappear when it turns out to be irrelevant, as it does in

hypot(infinity,NaN).

SEE ALSO

libm(3), sqrt(3)

AUTHOR

W. Kahan