~ubuntu-branches/ubuntu/precise/eglibc/precise-201308281639

« back to all changes in this revision

Viewing changes to math/s_ccosf.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-02-08 01:58:09 UTC
  • mfrom: (1.5.3) (288.1.12 precise)
  • Revision ID: package-import@ubuntu.com-20120208015809-ulscst7uteq3e22z
Tags: 2.15~pre6-0ubuntu10
Merge from Debian (r5151, 2.13-26).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Return cosine of complex float value.
2
 
   Copyright (C) 1997 Free Software Foundation, Inc.
 
2
   Copyright (C) 1997, 2011 Free Software Foundation, Inc.
3
3
   This file is part of the GNU C Library.
4
4
   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
5
5
 
21
21
#include <complex.h>
22
22
#include <fenv.h>
23
23
#include <math.h>
 
24
#include <math_private.h>
24
25
 
25
26
 
26
27
__complex__ float
27
28
__ccosf (__complex__ float x)
28
29
{
29
 
  __complex__ float res;
30
 
 
31
 
  if (!isfinite (__real__ x) || __isnanf (__imag__ x))
32
 
    {
33
 
      if (__real__ x == 0.0 || __imag__ x == 0.0)
34
 
        {
35
 
          __real__ res = __nanf ("");
36
 
          __imag__ res = 0.0;
37
 
 
38
 
#ifdef FE_INVALID
39
 
          if (__isinff (__real__ x))
40
 
            feraiseexcept (FE_INVALID);
41
 
#endif
42
 
        }
43
 
      else if (__isinff (__imag__ x))
44
 
        {
45
 
          __real__ res = HUGE_VALF;
46
 
          __imag__ res = __nanf ("");
47
 
 
48
 
#ifdef FE_INVALID
49
 
          if (__isinff (__real__ x))
50
 
            feraiseexcept (FE_INVALID);
51
 
#endif
52
 
        }
53
 
      else
54
 
        {
55
 
          __real__ res = __nanf ("");
56
 
          __imag__ res = __nanf ("");
57
 
 
58
 
#ifdef FE_INVALID
59
 
          if (isfinite (__imag__ x))
60
 
            feraiseexcept (FE_INVALID);
61
 
#endif
62
 
        }
63
 
    }
64
 
  else
65
 
    {
66
 
      __complex__ float y;
67
 
 
68
 
      __real__ y = -__imag__ x;
69
 
      __imag__ y = __real__ x;
70
 
 
71
 
      res = __ccoshf (y);
72
 
    }
73
 
 
74
 
  return res;
 
30
  __complex__ float y;
 
31
 
 
32
  __real__ y = -__imag__ x;
 
33
  __imag__ y = __real__ x;
 
34
 
 
35
  return __ccoshf (y);
75
36
}
76
37
#ifndef __ccosf
77
38
weak_alias (__ccosf, ccosf)