xref: /relibc/openlibm/src/w_cabs.c (revision 28fb939b0de8e3c8a7fd6064a7277410b84b292f)
1 /*
2  * cabs() wrapper for hypot().
3  *
4  * Written by J.T. Conklin, <jtc@wimsey.com>
5  * Placed into the Public Domain, 1994.
6  */
7 
8 #include "cdefs-compat.h"
9 //__FBSDID("$FreeBSD: src/lib/msun/src/w_cabs.c,v 1.7 2008/03/30 20:03:06 das Exp $");
10 
11 #include <float.h>
12 #include <openlibm_complex.h>
13 #include <openlibm_math.h>
14 
15 #include "math_private.h"
16 
17 OLM_DLLEXPORT double
18 cabs(double complex z)
19 {
20 	return hypot(creal(z), cimag(z));
21 }
22 
23 #if LDBL_MANT_DIG == 53
24 __weak_reference(cabs, cabsl);
25 #endif
26