Back to index

glibc  2.9
Functions
s_cprojf.c File Reference
#include <complex.h>
#include <math.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

__complex__ float __cprojf (__complex__ float x)

Function Documentation

__complex__ float __cprojf ( __complex__ float  x)

Definition at line 26 of file s_cprojf.c.

{
  __complex__ float res;

  if (isnan (__real__ x) && isnan (__imag__ x))
    return x;
  else if (!isfinite (__real__ x) || !isfinite (__imag__ x))
    {
      __real__ res = INFINITY;
      __imag__ res = __copysignf (0.0, __imag__ x);
    }
  else
    {
      float den = __real__ x * __real__ x + __imag__ x * __imag__ x + 1.0;

      __real__ res = (2.0 * __real__ x) / den;
      __imag__ res = (2.0 * __imag__ x) / den;
    }

  return res;
}

Here is the call graph for this function: