1994-08-19 09:40:01 +00:00
|
|
|
/*
|
|
|
|
* cabs() wrapper for hypot().
|
1995-05-30 05:51:47 +00:00
|
|
|
*
|
1994-08-19 09:40:01 +00:00
|
|
|
* Written by J.T. Conklin, <jtc@wimsey.com>
|
|
|
|
* Placed into the Public Domain, 1994.
|
|
|
|
*/
|
|
|
|
|
2008-02-22 02:30:36 +00:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
__FBSDID("$FreeBSD$");
|
1994-08-19 09:40:01 +00:00
|
|
|
|
2001-06-13 15:16:30 +00:00
|
|
|
#include <complex.h>
|
2008-03-30 20:03:06 +00:00
|
|
|
#include <float.h>
|
2001-06-13 15:16:30 +00:00
|
|
|
#include <math.h>
|
1994-08-19 09:40:01 +00:00
|
|
|
|
|
|
|
double
|
2008-03-30 20:03:06 +00:00
|
|
|
cabs(double complex z)
|
1994-08-19 09:40:01 +00:00
|
|
|
{
|
2001-06-13 15:16:30 +00:00
|
|
|
return hypot(creal(z), cimag(z));
|
1994-08-19 09:40:01 +00:00
|
|
|
}
|
2008-03-30 20:03:06 +00:00
|
|
|
|
|
|
|
#if LDBL_MANT_DIG == 53
|
|
|
|
__weak_reference(cabs, cabsl);
|
|
|
|
#endif
|