about summary refs log tree commit diff
path: root/src/complex/cprojf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/complex/cprojf.c')
-rw-r--r--src/complex/cprojf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/complex/cprojf.c b/src/complex/cprojf.c
new file mode 100644
index 00000000..71129743
--- /dev/null
+++ b/src/complex/cprojf.c
@@ -0,0 +1,8 @@
+#include "libm.h"
+
+float complex cprojf(float complex z)
+{
+	if (isinf(crealf(z)) || isinf(cimagf(z)))
+		return cpackf(INFINITY, copysignf(0.0, crealf(z)));
+	return z;
+}