cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ] #include <mathcw.h> extern float exp2f (float x); extern double exp2 (double x); extern long double exp2l (long double x); extern __float80 exp2w (__float80 x); extern __float128 exp2q (__float128 x); extern long_long_double exp2ll (long_long_double x); extern decimal_float exp2df (decimal_float x); extern decimal_double exp2d (decimal_double x); extern decimal_long_double exp2dl (decimal_long_double x); extern decimal_long_long_double exp2dll (decimal_long_long_double x);
NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.
This function is likely to be more accurate than the mathematically-equivalent expression using the power function, such as pow(2.0, x).
Caution: Because the function grows rapidly for arguments of large magnitude, it approaches Infinity fairly quickly. Also, for arguments of small magnitude, exp2(x) - 1 suffers loss of leading significant digits; use the accurate exp2m1(x) function instead.