summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/complex/cabsl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/src/complex/cabsl.c')
-rw-r--r--libc-top-half/musl/src/complex/cabsl.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/complex/cabsl.c b/libc-top-half/musl/src/complex/cabsl.c
new file mode 100644
index 0000000..d37e3f2
--- /dev/null
+++ b/libc-top-half/musl/src/complex/cabsl.c
@@ -0,0 +1,13 @@
+#include "complex_impl.h"
+
+#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
+long double cabsl(long double complex z)
+{
+ return cabs(z);
+}
+#else
+long double cabsl(long double complex z)
+{
+ return hypotl(creall(z), cimagl(z));
+}
+#endif