diff --git a/base/special/exp2/README.md b/base/special/exp2/README.md index e05c07486..a8a392b5a 100644 --- a/base/special/exp2/README.md +++ b/base/special/exp2/README.md @@ -75,6 +75,96 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/exp2.h" +``` + +#### stdlib_base_exp2( x ) + +Evaluates the base `2` [exponential function][exponential-function]. + +```c +double out = stdlib_base_exp2( 3.0 ); +// returns 8.0 + +out = stdlib_base_exp2( -9.0 ); +// returns ~0.002 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_exp2( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/exp2.h" +#include +#include + +int main( void ) { + double x; + double v; + int i; + + for ( i = 0; i < 100; i++ ) { + x = ( ( (double)rand() / (double)RAND_MAX ) * 100.0 ) - 50.0; + v = stdlib_base_exp2( x ); + printf( "2^%lf = %lf\n", x, v ); + } +} +``` + +
+ + + +
+ + +