diff options
Diffstat (limited to 'lib/msun/src/w_cabs.c')
-rw-r--r-- | lib/msun/src/w_cabs.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/msun/src/w_cabs.c b/lib/msun/src/w_cabs.c index b140515..a33a41f 100644 --- a/lib/msun/src/w_cabs.c +++ b/lib/msun/src/w_cabs.c @@ -5,23 +5,24 @@ * Placed into the Public Domain, 1994. */ -#include <math.h> +#ifndef lint +static const char rcsid[] = + "$FreeBSD$"; +#endif /* not lint */ -struct complex { - double x; - double y; -}; +#include <complex.h> +#include <math.h> double cabs(z) - struct complex z; + double complex z; { - return hypot(z.x, z.y); + return hypot(creal(z), cimag(z)); } double z_abs(z) - struct complex *z; + double complex *z; { - return hypot(z->x, z->y); + return hypot(creal(*z), cimag(*z)); } |