summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/complex/cprojf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/src/complex/cprojf.c')
-rw-r--r--libc-top-half/musl/src/complex/cprojf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/complex/cprojf.c b/libc-top-half/musl/src/complex/cprojf.c
new file mode 100644
index 0000000..15a874b
--- /dev/null
+++ b/libc-top-half/musl/src/complex/cprojf.c
@@ -0,0 +1,8 @@
+#include "complex_impl.h"
+
+float complex cprojf(float complex z)
+{
+ if (isinf(crealf(z)) || isinf(cimagf(z)))
+ return CMPLXF(INFINITY, copysignf(0.0, cimagf(z)));
+ return z;
+}