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

« back to all changes in this revision

Viewing changes to math/s_clog10.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2011-10-04 17:48:26 UTC
  • mfrom: (216.1.23 oneiric)
  • Revision ID: package-import@ubuntu.com-20111004174826-2cyb9ewn3ucymlsx
Tags: 2.13-20ubuntu5
libc6-dev: Don't break the current {gnat,gcj}-4.4-base versons. LP: #853688.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Compute complex base 10 logarithm.
2
 
   Copyright (C) 1997, 2011 Free Software Foundation, Inc.
 
2
   Copyright (C) 1997 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
 
20
20
 
21
21
#include <complex.h>
22
22
#include <math.h>
23
 
#include <math_private.h>
 
23
 
 
24
#include "math_private.h"
24
25
 
25
26
 
26
27
__complex__ double
30
31
  int rcls = fpclassify (__real__ x);
31
32
  int icls = fpclassify (__imag__ x);
32
33
 
33
 
  if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0))
 
34
  if (rcls == FP_ZERO && icls == FP_ZERO)
34
35
    {
35
36
      /* Real and imaginary part are 0.0.  */
36
37
      __imag__ result = signbit (__real__ x) ? M_PI : 0.0;
38
39
      /* Yes, the following line raises an exception.  */
39
40
      __real__ result = -1.0 / fabs (__real__ x);
40
41
    }
41
 
  else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1))
 
42
  else if (rcls != FP_NAN && icls != FP_NAN)
42
43
    {
43
44
      /* Neither real nor imaginary part is NaN.  */
44
45
      __real__ result = __ieee754_log10 (__ieee754_hypot (__real__ x,