cproj, cprojf, or cprojl Subroutine

Purpose

Computes the complex projection functions.

Syntax

#include <complex.h>

double complex cproj (z)
double complex z;

float complex cprojf (z)
float complex z;

long double complex cprojl (z)
long double complex z;

Description

The cproj, cprojf, and cprojl subroutines 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, cproj(z) shall be equivalent to:

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

Parameters

Item Description
z Specifies the value to be projected.

Return Values

The cproj, cprojf, and cprojl subroutines return the value of the projection onto the Riemann sphere.