HYPOT(3) Linux Programmer's Manual HYPOT(3)

hypot, hypotf, hypotl - Euclidean distance function

#include <math.h>

double hypot(double x, double y);

float hypotf(float x, float y);

long double hypotl(long double x, long double y);

Link with -lm.


Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

hypot(), hypotf(), hypotl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE; or cc -std=c99

The hypot() function returns sqrt(x*x+y*y). This is the length of the hypotenuse of a right-angle triangle with sides of length x and y, or the distance of the point (x,y) from the origin.

SVr4, 4.3BSD, C99. The float and long double variants are C99 requirements.

cabs(3), sqrt(3)

2007-07-26

Different Versions of this Page: