cb27159e4f16bb7e74d10d0ed74ca6d5dc1f786f
[platform/upstream/glibc.git] / sysdeps / libm-ieee754 / w_exp10.c
1 /* @(#)w_exp10.c
2  * Conversion to exp10 by Ulrich Drepper <drepper@cygnus.com>.
3 /*
4  * ====================================================
5  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6  *
7  * Developed at SunPro, a Sun Microsystems, Inc. business.
8  * Permission to use, copy, modify, and distribute this
9  * software is freely granted, provided that this notice
10  * is preserved.
11  * ====================================================
12  */
13
14 /*
15  * wrapper exp10(x)
16  */
17
18 #include "math.h"
19 #include "math_private.h"
20
21 #ifdef __STDC__
22 static const double
23 #else
24 static double
25 #endif
26 o_threshold=  3.0825471555991674389672e+02,
27 u_threshold= -3.2360724533877978485251e+02;
28
29 #ifdef __STDC__
30         double __exp10(double x)                /* wrapper exp10 */
31 #else
32         double __exp10(x)                       /* wrapper exp10 */
33         double x;
34 #endif
35 {
36 #ifdef _IEEE_LIBM
37         return __ieee754_exp10(x);
38 #else
39         double z;
40         z = __ieee754_exp10(x);
41         if(_LIB_VERSION == _IEEE_) return z;
42         if(__finite(x)) {
43             if(x>o_threshold)
44                 return __kernel_standard(x,x,46); /* exp10 overflow */
45             else if(x<u_threshold)
46                 return __kernel_standard(x,x,47); /* exp10 underflow */
47         }
48         return z;
49 #endif
50 }
51 weak_alias (__exp10, exp10)
52 strong_alias (__exp10, __pow10)
53 weak_alias (__pow10, pow10)
54 #ifdef NO_LONG_DOUBLE
55 strong_alias (__exp10, __exp10l)
56 weak_alias (__exp10, exp10l)
57 strong_alias (__exp10l, __pow10l)
58 weak_alias (__pow10l, pow10l)
59 #endif