United States-English |
|
|
HP-UX Reference > Hhypot(3M)HP-UX 11i Version 3: February 2007 |
|
NAMEhypotf(), hypotl(), hypotw(), hypotq() — Euclidean distance functions DESCRIPTIONhypot() computes the square root of the sum of the squares of x and y, without undue overflow or underflow. Integrity Server Onlyhypotf() is a float version of hypot(); it takes float arguments and returns a float result. hypotl() is a long double version of hypot(); it takes long double arguments and returns a long double result. hypotw() is an extended version of hypot(); it takes extended arguments and returns an extended result. hypotq() is equivalent to hypotl() on HP-UX systems. USAGETo use any of these functions, compile either with the default -Ae option or with the -Aa and -D_HPUX_SOURCE options. To use (for Integrity servers) hypotw() or hypotq(), compile also with the -fpwidetypes option. Make sure your program includes <math.h>. Link in the math library by specifying -lm on the compiler or linker command line. RETURN VALUEhypot(x,y), hypot(y,x), and hypot(x,-y) are equivalent. hypot(x,±0) is equivalent to fabs(x). hypot(±Inf,y) returns +Inf, even if y is a NaN. If both arguments are NaNs, then hypot() returns a NaN. hypot() returns infinity in lieu of a value whose magnitude is too large, and raises the overflow and inexact exceptions. hypot() raises the underflow and inexact exceptions whenever a result is tiny (essentially denormal or zero) and thereby suffers loss of accuracy, and may raise those exceptions if the result is merely tiny. hypot() raises the inexact exception whenever a rounded result does not equal the mathematical result. |
Printable version | ||
|