initial cmath code and minor libm.h update
[libm] / src / cmath / cabs.c
diff --git a/src/cmath/cabs.c b/src/cmath/cabs.c
new file mode 100644 (file)
index 0000000..f61d364
--- /dev/null
@@ -0,0 +1,6 @@
+#include "libm.h"
+
+double cabs(double complex z)
+{
+       return hypot(creal(z), cimag(z));
+}