File: w_exp2_compat.c

package info (click to toggle)
glibc 2.41-10
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 300,192 kB
  • sloc: ansic: 1,050,471; asm: 238,243; makefile: 20,378; python: 13,537; sh: 11,823; cpp: 5,197; awk: 1,795; perl: 317; yacc: 292; pascal: 182; sed: 19
file content (37 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * wrapper exp2(x)
 */

#include <math.h>
#include <math_private.h>
#include <math-svid-compat.h>
#include <libm-alias-double.h>

#if LIBM_SVID_COMPAT && (SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_29) \
			 || defined NO_LONG_DOUBLE \
			 || defined LONG_DOUBLE_COMPAT)
double
__exp2_compat (double x)
{
  double z = __ieee754_exp2 (x);
  if (__builtin_expect (!isfinite (z) || z == 0, 0)
      && isfinite (x) && _LIB_VERSION != _IEEE_)
    /* exp2 overflow: 44, exp2 underflow: 45 */
    return __kernel_standard (x, x, 44 + !!signbit (x));

  return z;
}
# if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_29)
compat_symbol (libm, __exp2_compat, exp2, GLIBC_2_1);
# endif
# ifdef NO_LONG_DOUBLE
weak_alias (__exp2_compat, exp2l)
# endif
# ifdef LONG_DOUBLE_COMPAT
/* Work around gas bug "multiple versions for symbol".  */
weak_alias (__exp2_compat, __exp2_compat_alias)

LONG_DOUBLE_COMPAT_CHOOSE_libm_exp2l (
  compat_symbol (libm, __exp2_compat_alias, exp2l, FIRST_VERSION_libm_exp2l), );
# endif
#endif