diff --git a/lib/node_modules/@stdlib/math/base/special/round2/README.md b/lib/node_modules/@stdlib/math/base/special/round2/README.md index a4988a95d368..61d621eebec5 100644 --- a/lib/node_modules/@stdlib/math/base/special/round2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/round2/README.md @@ -101,6 +101,91 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/round2.h" +``` + +#### stdlib_base_round2( x ) + +Rounds a `numeric` value to the nearest power of two on a linear scale. + +```c +double out = stdlib_base_round2( -4.2 ); +// returns -4.0 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_round2( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/round2.h" +#include + +int main( void ) { + const double x[] = { -5.0, -3.89, -2.78, -1.67, -0.56, 0.56, 1.67, 2.78, 3.89, 5.0 }; + + double v; + int i; + for ( i = 0; i < 10; i++ ) { + v = stdlib_base_round2( x[ i ] ); + printf( "round2(%lf) = %lf\n", x[ i ], v ); + } +} +``` + +
+ + + +
+ + +