6.2.52 cprojf Function

Calculates the a projection of a single precision complex value onto the Riemann sphere.

Attention: This function is implemented only by MPLAB XC32 C compilers.

Include

<complex.h>

Prototype

float complex cprojf(float complex z);

Argument

z
value for which to calculate the projection

Return Value

Returns the a projection of a single precision complex value, z, onto the Riemann sphere. The projection is such that z is returned, except if z is any complex infinity, in which case a positive infinity is returned.

Example

See the notes at the beginning of this chapter or section for information on using printf() or scanf() (and other functions reading and writing the stdin or stdout streams) in the example code.

#include <stdio.h>
#include <complex.h>
#include <math.h>

int main(void)
{
  float complex x;

  x = -INFINITY + 1.0*I;
  y = cprojf(x);
  printf("The Riemann plane projection of %f + %fi is %f + %fi\n", crealf(x), cimagf(x), crealf(y), cimagf(y));
}

Example Output

The Riemann plane projection of -inf + 1.000000i is inf + 0.000000i