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

« back to all changes in this revision

Viewing changes to math/w_exp2l.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:
4
4
 
5
5
#include <float.h>
6
6
#include <math.h>
7
 
#include <math_private.h>
 
7
#include "math_private.h"
8
8
 
9
9
static const long double o_threshold = (long double) LDBL_MAX_EXP;
10
10
static const long double u_threshold
11
11
  = (long double) (LDBL_MIN_EXP - LDBL_MANT_DIG - 1);
12
12
 
13
13
long double
14
 
__exp2l (long double x)
 
14
__exp2l (long double x)                 /* wrapper exp2l */
15
15
{
16
 
  if (__builtin_expect (x <= u_threshold || x > o_threshold, 0)
17
 
      && _LIB_VERSION != _IEEE_ && __finitel (x))
18
 
    /* exp2 overflow: 244, exp2 underflow: 245 */
19
 
    return __kernel_standard (x, x, 244 + (x <= o_threshold));
20
 
 
 
16
#ifdef _IEEE_LIBM
21
17
  return __ieee754_exp2l (x);
 
18
#else
 
19
  long double z;
 
20
  z = __ieee754_exp2l (x);
 
21
  if (_LIB_VERSION != _IEEE_ && __finitel (x))
 
22
    {
 
23
      if (x > o_threshold)
 
24
        return __kernel_standard (x, x, 244); /* exp2l overflow */
 
25
      else if (x <= u_threshold)
 
26
        return __kernel_standard (x, x, 245); /* exp2l underflow */
 
27
    }
 
28
  return z;
 
29
#endif
22
30
}
23
31
weak_alias (__exp2l, exp2l)