Bring in FreeBSD's msun code for our libm.
[dragonfly.git] / lib / libm / src / w_cabs.c
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  * $FreeBSD: head/lib/msun/src/w_cabs.c 177758 2008-03-30 20:03:06Z das $
8  */
9
10 #include <complex.h>
11 #include <float.h>
12 #include <math.h>
13
14 double
15 cabs(double complex z)
16 {
17         return hypot(creal(z), cimag(z));
18 }
19
20 #if LDBL_MANT_DIG == 53
21 __weak_reference(cabs, cabsl);
22 #endif