Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

hypot, hypotf, hypotl - Euclidean distance function

&pagelevel(4)&pagelevel

Syntax

#include <math.h>

double hypot(double x, double y);
C11 float hypotf(float x, float y);
long double hypotl(long double x, long double y); (End) 

Description

These functions compute the Euclidean distance. x and y are the coordinates of the point for
which the Euclidean distance is to be computed.

Return val.

sqrt(x *x + y *y) if successful.

HUGE_VAL
HUGE_VALF
HUGE_VALL

depending on the function type, if an overflow occurs. errno is set to indicate the error.

Errors

hypot() will fail if:

ERANGE      Overflow; the result is too large.

See also

cabs(), sqrt(), math.h.