Back to index

glibc  2.9
Functions
s_ccos.c File Reference
#include <complex.h>
#include <fenv.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__ double __ccos (__complex__ double x)

Function Documentation

__complex__ double __ccos ( __complex__ double  x)

Definition at line 27 of file s_ccos.c.

{
  __complex__ double res;

  if (!isfinite (__real__ x) || __isnan (__imag__ x))
    {
      if (__real__ x == 0.0 || __imag__ x == 0.0)
       {
         __real__ res = __nan ("");
         __imag__ res = 0.0;

#ifdef FE_INVALID
         if (__isinf (__real__ x))
           feraiseexcept (FE_INVALID);
#endif
       }
      else if (__isinf (__imag__ x))
       {
         __real__ res = HUGE_VAL;
         __imag__ res = __nan ("");

#ifdef FE_INVALID
         if (__isinf (__real__ x))
           feraiseexcept (FE_INVALID);
#endif
       }
      else
       {
         __real__ res = __nan ("");
         __imag__ res = __nan ("");

#ifdef FE_INVALID
         if (isfinite (__imag__ x))
           feraiseexcept (FE_INVALID);
#endif
       }
    }
  else
    {
      __complex__ double y;

      __real__ y = -__imag__ x;
      __imag__ y = __real__ x;

      res = __ccosh (y);
    }

  return res;
}

Here is the call graph for this function: