cprojf, cproj, cprojl

From cppreference.com
< c‎ | numeric‎ | complex
Defined in header <complex.h>
float       cprojf( float complex z );
(since C99)
double      cproj( double complex z );
(since C99)
long double cprojl( long double complex z );
(since C99)

Computes the projection of z on the Riemann sphere.

Contents

[edit] Parameters

z - complex argument

[edit] Return value

The projection of z on the Riemann sphere.

[edit] Example

#include <stdio.h>
#include <complex.h>
#include <math.h>
 
int main(void)
{
    double complex z = cproj(INFINITY+2.0*I);
    printf("%.1f%+.1fi\n", creal(z),cimag(z));
 
    return 0;
}

Output:

inf+0.0i

[edit] See also