Next: ilogb
, ilogbf
—get exponent of floating-point number, Previous: gamma
, gammaf
, lgamma
, lgammaf
, gamma_r
, gammaf_r
, lgamma_r
, lgammaf_r
, tgamma
, and tgammaf
—logarithmic and plain gamma functions, Up: Mathematical Functions (math.h) [Contents][Index]
hypot
, hypotf
—distance from originSynopsis
#include <math.h> double hypot(double x, double y); float hypotf(float x, float y);
Description
hypot
calculates the Euclidean distance
sqrt(x*x + y*y)
between the origin (0,0) and a point represented by the
Cartesian coordinates (x,y). hypotf
differs only
in the type of its arguments and result.
Returns
Normally, the distance value is returned. On overflow,
hypot
returns HUGE_VAL
and sets errno
to
ERANGE
.
Portability
hypot
and hypotf
are not ANSI C.