diff --git a/CHANGELOG.md b/CHANGELOG.md index 3178e8b51..8aa913d37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@
-## Unreleased (2024-06-30) +## Unreleased (2024-07-04)
@@ -3095,6 +3095,28 @@ This release closes the following issue: +
+ +#### [@stdlib/math/base/special/floor2](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/floor2) + +
+ +
+ +##### Features + +- [`82c8ae0`](https://github.com/stdlib-js/stdlib/commit/82c8ae03edea7886ce0f67ca6e1c2a3028ef8fd9) - add C implementation for `math/base/special/floor2` + +
+ + + +
+ +
+ + +
#### [@stdlib/math/base/special/frexp](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/frexp) @@ -4856,6 +4878,7 @@ A total of 29 people contributed to this release. Thank you to the following con
+- [`82c8ae0`](https://github.com/stdlib-js/stdlib/commit/82c8ae03edea7886ce0f67ca6e1c2a3028ef8fd9) - **feat:** add C implementation for `math/base/special/floor2` _(by Gunj Joshi)_ - [`2f62c39`](https://github.com/stdlib-js/stdlib/commit/2f62c39e03c5445f3cc3b91226453c2eed366013) - **chore:** update package meta data [(##2481)](#2481) _(by stdlib-bot)_ - [`581f5a0`](https://github.com/stdlib-js/stdlib/commit/581f5a0dd601746dbf6366d073dcc391efc601d7) - **feat:** add C implementation for `math/base/special/trunc10` [(##2451)](#2451) _(by Gunj Joshi)_ - [`9e56edf`](https://github.com/stdlib-js/stdlib/commit/9e56edf06218960bb5a3b1c22a5a2198f2dc0cb9) - **chore:** minor clean-up of `math/base/special/acsc` _(by Pranav Goswami, Athan Reines, Philipp Burckhardt)_ diff --git a/base/special/floor2/README.md b/base/special/floor2/README.md index bd6edd16b..3e4b0b4e1 100644 --- a/base/special/floor2/README.md +++ b/base/special/floor2/README.md @@ -101,6 +101,91 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/floor2.h" +``` + +#### stdlib_base_floor2( x ) + +Rounds a `numeric` value to the nearest power of two toward negative infinity. + +```c +double y = stdlib_base_floor2( -4.2 ); +// returns -8.0 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_floor2( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/floor2.h" +#include + +int main( void ) { + const double x[] = { 3.14, -3.14, 0.0, 0.0 / 0.0 }; + + double y; + int i; + for ( i = 0; i < 4; i++ ) { + y = stdlib_base_floor2( x[ i ] ); + printf( "floor2(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +