Next: creal, Previous: cpow, Up: Complex [Contents][Index]

### 2.17 `cproj`, `cprojf`— Riemann sphere projection

Synopsis

    #include <complex.h>
    double complex cproj(double complex z);
    float complex cprojf(float complex z);

Description
These functions compute a projection of z onto the Riemann sphere: z projects to z except that all complex infinities (even those with one infinite part and one NaN part) project to positive infinity on the real axis. If z has an infinite part, then `cproj`(z) is equivalent to

INFINITY + I * copysign(0.0, cimag(z))

`cprojf` is identical to `cproj`, except that it performs its calculations on `floats complex`.

Returns
The cproj functions return the value of the projection onto the Riemann sphere.

Portability
`cproj` and `cprojf` are ISO C99