10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
24 */
25 /*
26 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
28 */
29
30 #pragma weak exp10l = __exp10l
31
32 #include "libm.h"
33 #include "longdouble.h"
34
35 /*
36 * exp10l(x)
37 * n = nint(x*(log10/log2)) ;
38 * exp10(x) = 10**x = exp(x*ln(10)) = exp(n*ln2+(x*ln10-n*ln2))
39 * = 2**n*exp(ln10*(x-n*log2/log10)))
40 * If x is an integer <= M then use repeat multiplication. For
41 * 10**M is the largest representable integer, where
42 * M = 10 single precision (24 bits)
43 * M = 22 double precision (53 bits)
44 * M = 48 quadruple precision (113 bits)
45 */
46
47 #define TINY 1.0e-20L /* single: 1e-5, double: 1e-10, quad: 1e-20 */
48 #define LG10OVT 4933.L /* single: 39, double: 309, quad: 4933 */
49 #define LG10UFT -4966.L /* single: -45, double: -323, quad: -4966 */
50 #define M 48
51 /* logt2hi : last 32 bits is zero for quad prec */
|
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
24 */
25 /*
26 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
28 */
29
30 #include "libm.h"
31 #include "longdouble.h"
32
33 /*
34 * exp10l(x)
35 * n = nint(x*(log10/log2)) ;
36 * exp10(x) = 10**x = exp(x*ln(10)) = exp(n*ln2+(x*ln10-n*ln2))
37 * = 2**n*exp(ln10*(x-n*log2/log10)))
38 * If x is an integer <= M then use repeat multiplication. For
39 * 10**M is the largest representable integer, where
40 * M = 10 single precision (24 bits)
41 * M = 22 double precision (53 bits)
42 * M = 48 quadruple precision (113 bits)
43 */
44
45 #define TINY 1.0e-20L /* single: 1e-5, double: 1e-10, quad: 1e-20 */
46 #define LG10OVT 4933.L /* single: 39, double: 309, quad: 4933 */
47 #define LG10UFT -4966.L /* single: -45, double: -323, quad: -4966 */
48 #define M 48
49 /* logt2hi : last 32 bits is zero for quad prec */
|