Back to index

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

Go to the source code of this file.

Functions

__complex__ long double __clogl (__complex__ long double x)

Function Documentation

__complex__ long double __clogl ( __complex__ long double  x)

Definition at line 28 of file s_clogl.c.

{
  __complex__ long double result;
  int rcls = fpclassify (__real__ x);
  int icls = fpclassify (__imag__ x);

  if (rcls == FP_ZERO && icls == FP_ZERO)
    {
      /* Real and imaginary part are 0.0.  */
      __imag__ result = signbit (__real__ x) ? M_PIl : 0.0;
      __imag__ result = __copysignl (__imag__ result, __imag__ x);
      /* Yes, the following line raises an exception.  */
      __real__ result = -1.0 / fabsl (__real__ x);
    }
  else if (rcls != FP_NAN && icls != FP_NAN)
    {
      /* Neither real nor imaginary part is NaN.  */
      __real__ result = __ieee754_logl (__ieee754_hypotl (__real__ x,
                                                   __imag__ x));
      __imag__ result = __ieee754_atan2l (__imag__ x, __real__ x);
    }
  else
    {
      __imag__ result = __nanl ("");
      if (rcls == FP_INFINITE || icls == FP_INFINITE)
       /* Real or imaginary part is infinite.  */
       __real__ result = HUGE_VALL;
      else
       __real__ result = __nanl ("");
    }

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function: