2.9
[glibc/nacl-glibc.git] / sysdeps / ieee754 / ldbl-128 / w_expl.c
blob816ce3caa65f677622e8822b503bb97bfc276874
1 /* w_expl.c -- long double version of w_exp.c.
2 * Conversion to long double by Ulrich Drepper,
3 * Cygnus Support, drepper@cygnus.com.
4 */
6 /*
7 * ====================================================
8 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
10 * Developed at SunPro, a Sun Microsystems, Inc. business.
11 * Permission to use, copy, modify, and distribute this
12 * software is freely granted, provided that this notice
13 * is preserved.
14 * ====================================================
17 #if defined(LIBM_SCCS) && !defined(lint)
18 static char rcsid[] = "$NetBSD: $";
19 #endif
22 * wrapper expl(x)
25 #include "math.h"
26 #include "math_private.h"
28 #ifdef __STDC__
29 static const long double
30 #else
31 static long double
32 #endif
33 o_threshold= 1.1356523406294143949491931077970763428449E4L,
34 u_threshold= -1.1433462743336297878837243843452621503410E4;
36 #ifdef __STDC__
37 long double __expl(long double x) /* wrapper exp */
38 #else
39 long double __expl(x) /* wrapper exp */
40 long double x;
41 #endif
43 #ifdef _IEEE_LIBM
44 return __ieee754_expl(x);
45 #else
46 long double z;
47 z = __ieee754_expl(x);
48 if(_LIB_VERSION == _IEEE_) return z;
49 if(__finitel(x)) {
50 if(x>o_threshold)
51 return __kernel_standard(x,x,206); /* exp overflow */
52 else if(x<u_threshold)
53 return __kernel_standard(x,x,207); /* exp underflow */
55 return z;
56 #endif
58 weak_alias (__expl, expl)