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