7e9318e5755bece9aa743e996a3985b29e5cab15
[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  * $NetBSD: w_cabs.c,v 1.4 2001/01/06 00:15:00 christos Exp $
8  * $DragonFly: src/lib/libm/src/w_cabs.c,v 1.1 2005/07/26 21:15:20 joerg Exp $
9  */
10
11 #include <complex.h>
12 #include <math.h>
13
14 double
15 cabs(double complex z)
16 {
17         return hypot(creal(z), cimag(z));
18 }