1
2 /* @(#)w_exp2.c 5.1 93/09/24 */
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 FUNCTION
16 <<exp2>>, <<exp2f>>---exponential, base 2
17 INDEX
18 exp2
19 INDEX
20 exp2f
21
22 SYNOPSIS
23 #include <math.h>
24 double exp2(double <[x]>);
25 float exp2f(float <[x]>);
26
27 DESCRIPTION
28 <<exp2>> and <<exp2f>> calculate 2 ^ <[x]>, that is,
29 @ifnottex
30 2 raised to the power <[x]>.
31 @end ifnottex
32 @tex
33 $2^x$
34 @end tex
35
36 RETURNS
37 On success, <<exp2>> and <<exp2f>> return the calculated value.
38 If the result underflows, the returned value is <<0>>. If the
39 result overflows, the returned value is <<HUGE_VAL>>. In
40 either case, <<errno>> is set to <<ERANGE>>.
41
42 PORTABILITY
43 ANSI C, POSIX.
44
45 */
46
47 /*
48 * wrapper exp2(x)
49 */
50
51 #include "fdlibm.h"
52 #if __OBSOLETE_MATH_DOUBLE
53 #ifdef _NEED_FLOAT64
54
55 extern __float64 _pow64(__float64, __float64);
56
57 __float64 __inhibit_new_builtin_calls
exp264(__float64 x)58 exp264(__float64 x) /* wrapper exp2 */
59 {
60 return _pow64(2.0, x);
61 }
62
63 _MATH_ALIAS_d_d(exp2)
64
65 #endif /* _NEED_FLOAT64 */
66 #else
67 #include "../common/exp2.c"
68 #endif /* __OBSOLETE_MATH_DOUBLE */
69