Chapter Contents

Previous

Next
exp2

exp2



Compute the base 2 exponential function

Portability: C99


SYNOPSIS
DESCRIPTION
RETURN VALUE
DIAGNOSTICS
RELATED FUNCTIONS
SEE ALSO


SYNOPSIS

   #include <math.h>

   double exp2(double x);
   float exp2f(float x);
   long double exp2l(long double x);


DESCRIPTION

exp2 computes the the base 2 exponential function of its argument x. This function is expressed by the following relation:

[IMAGE]

The function name exp2f should be used for float arguments, and exp2l for long double arguments. Alternately, if the header file tgmath.h is included, exp2 may be used with any numeric argument type.


RETURN VALUE

exp2 returns the base 2 exponential function of its argument, provided this value is expressible.


DIAGNOSTICS

If the result of exp2 is too large to represent, it returns HUGE_VAL in hexadecimal floating point, and either infinity or the largest finite value in binary floating point, depending on the rounding mode. In this case, the run-time library writes an error message to the standard error file (stderr).

If an error occurs in exp2, the _matherr or _matherb routine is called. You can supply your own version of _matherr or _matherb to suppress the diagnostic message or modify the value returned.


RELATED FUNCTIONS

exp, log2, _matherb, _matherr


SEE ALSO

"Mathematical Functions" in Chapter 2, "Function Categories"


Chapter Contents

Previous

Next

Top of Page

Copyright © 2004 by SAS Institute Inc., Cary, NC, USA. All rights reserved.