xref: /freebsd/lib/msun/src/w_cabs.c (revision d0b2dbfa)
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 <sys/cdefs.h>
9 #include <complex.h>
10 #include <float.h>
11 #include <math.h>
12 
13 double
14 cabs(double complex z)
15 {
16 	return hypot(creal(z), cimag(z));
17 }
18 
19 #if LDBL_MANT_DIG == 53
20 __weak_reference(cabs, cabsl);
21 #endif
22