diff options
Diffstat (limited to 'src/complex/cproj.c')
-rw-r--r-- | src/complex/cproj.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/complex/cproj.c b/src/complex/cproj.c new file mode 100644 index 00000000..1cf9bb94 --- /dev/null +++ b/src/complex/cproj.c @@ -0,0 +1,8 @@ +#include "libm.h" + +double complex cproj(double complex z) +{ + if (isinf(creal(z)) || isinf(cimag(z))) + return cpack(INFINITY, copysign(0.0, creal(z))); + return z; +} |