diff --git a/CHANGELOG.md b/CHANGELOG.md index f51504efc..90161adb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1956,6 +1956,28 @@ This release closes the following issue: +
+ +#### [@stdlib/math/base/special/ceil2](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/ceil2) + +
+ +
+ +##### Features + +- [`06fd785`](https://github.com/stdlib-js/stdlib/commit/06fd785919d2ef770b5a2bffd69dd4d3c36e8294) - add C implementation for `math/base/special/ceil2` [(##2602)](#2602) + +
+ + + +
+ +
+ + +
#### [@stdlib/math/base/special/cexp](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/cexp) @@ -5110,6 +5132,7 @@ A total of 29 people contributed to this release. Thank you to the following con
+- [`06fd785`](https://github.com/stdlib-js/stdlib/commit/06fd785919d2ef770b5a2bffd69dd4d3c36e8294) - **feat:** add C implementation for `math/base/special/ceil2` [(##2602)](#2602) _(by Gunj Joshi)_ - [`fe25386`](https://github.com/stdlib-js/stdlib/commit/fe25386fdcdbb684dc96990ba12171d5bf62df6d) - **feat:** add C implementation for `math/base/special/floorsd` [(##2603)](#2603) _(by Gunj Joshi)_ - [`08dbbe5`](https://github.com/stdlib-js/stdlib/commit/08dbbe5a6fa6a3b82c049ef03deaa6eb8daaaee9) - **test:** add tests for negative values in `math/base/special/fmod` [(#2600)](https://github.com/stdlib-js/stdlib/pull/2600) _(by Gunj Joshi)_ - [`d04dcbd`](https://github.com/stdlib-js/stdlib/commit/d04dcbd6dc3b0bf4a89bd3947d317fa5ff15bb38) - **docs:** remove private annotations in C comments _(by Philipp Burckhardt)_ diff --git a/base/special/ceil2/README.md b/base/special/ceil2/README.md index d328dcf6c..f05181c33 100644 --- a/base/special/ceil2/README.md +++ b/base/special/ceil2/README.md @@ -101,6 +101,91 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/ceil2.h" +``` + +#### stdlib_base_ceil2( x ) + +Rounds a `numeric` value to the nearest power of two toward positive infinity. + +```c +double y = stdlib_base_ceil2( 3.14 ); +// returns 4.0 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_ceil2( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/ceil2.h" +#include + +int main( void ) { + const double x[] = { 3.14, -3.14, 0.5, 0.0 / 0.0 }; + + double y; + int i; + for ( i = 0; i < 4; i++ ) { + y = stdlib_base_ceil2( x[ i ] ); + printf( "ceil2(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +