OSDN Git Service

f1d2d730a8e05f2b43cc1c76690a85aed6a2482c
[pf3gnuchains/pf3gnuchains3x.git] / winsup / mingw / mingwex / complex / cprojf.c
1 /*
2    cprojf.c
3    Contributed by Danny Smith
4    2004-12-24
5 */
6
7 #include <math.h>
8 #include <complex.h>
9
10 /* Return the value of the projection onto the Riemann sphere.*/
11
12 float complex cprojf (float complex Z)
13 {
14   complex float Res = Z;
15   if (isinf (__real__ Z) || isinf (__imag__ Z))
16     {
17       __real__ Res = HUGE_VALF;
18       __imag__ Res = copysignf (0.0f, __imag__ Z);
19     }
20   return Res;
21 }
22