summaryrefslogtreecommitdiff
path: root/libm/w_cabs.c
diff options
context:
space:
mode:
Diffstat (limited to 'libm/w_cabs.c')
-rw-r--r--libm/w_cabs.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/libm/w_cabs.c b/libm/w_cabs.c
index 69188a0dd..6743146c6 100644
--- a/libm/w_cabs.c
+++ b/libm/w_cabs.c
@@ -5,14 +5,10 @@
* Placed into the Public Domain, 1994.
*/
+#include <complex.h>
#include <math.h>
-struct complex {
- double x;
- double y;
-};
-
-double cabs(struct complex z)
+double cabs(double _Complex z)
{
- return hypot(z.x, z.y);
+ return hypot(__real__ z, __imag__ z);
}