Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

isinf(3M)

isnan(3M)

matherr(3M)

hypot(3M)

NAME

hypot(), cabs() − Euclidean distance function, complex absolute value

SYNOPSIS

#include <math.h>

double hypot(double x, double y);

double cabs(struct {double x, y;} z);

DESCRIPTION

hypot() and cabs() return sqrt(x*x +y*y) , taking precautions against unwarranted overflows. 

hypot() and cabs() return +INFINITY when x or y is ±INFINITY. 

ERRORS

/lib/libm.a

When the correct value would overflow, hypot() and cabs() return HUGE_VAL and set errno to ERANGE. 

hypot() and cabs() return NaN and set errno to EDOM when x or y is NaN. 

These error-handling procedures can be changed with the matherr() function (see matherr(3M)).

/lib/libM.a

No error messages are printed on the standard error output. 

When the correct value would overflow, hypot() and cabs() return HUGE_VAL and set errno to ERANGE. 

hypot() and cabs() return NaN and set errno to EDOM when x or y is NaN. 

These error-handling procedures can be changed by using the _matherr() function (see matherr(3M)). Note that _matherr() is provided in order to assist in migrating programs from libm.a to libM.a and is not a part of XPG3, ANSI C, or POSIX. 

SEE ALSO

isinf(3M), isnan(3M), matherr(3M). 

STANDARDS CONFORMANCE

hypot() in libm.a: AES, SVID2, XPG2, XPG3
hypot() in libM.a: AES, XPG3, XPG4

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026