diff --git a/CHANGELOG.md b/CHANGELOG.md index f005b90a6..564f3ae38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@
-## Unreleased (2024-06-23) +## Unreleased (2024-06-24)
@@ -4404,6 +4404,28 @@ A total of 2 issues were closed in this release: +
+ +#### [@stdlib/math/base/special/trunc2](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/trunc2) + +
+ +
+ +##### Features + +- [`523d68f`](https://github.com/stdlib-js/stdlib/commit/523d68f43c345228b28262e88dc2d820b6ad7592) - add C implementation for `math/base/special/trunc2` [(##2436)](#2436) + +
+ + + +
+ +
+ + +
#### [@stdlib/math/base/special/vercos](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/vercos) @@ -4811,6 +4833,7 @@ A total of 29 people contributed to this release. Thank you to the following con
+- [`523d68f`](https://github.com/stdlib-js/stdlib/commit/523d68f43c345228b28262e88dc2d820b6ad7592) - **feat:** add C implementation for `math/base/special/trunc2` [(##2436)](#2436) _(by Gunj Joshi)_ - [`e26363d`](https://github.com/stdlib-js/stdlib/commit/e26363d5a9df20243c6be186bbf63017517c5839) - **chore:** update package meta data [(#2439)](https://github.com/stdlib-js/stdlib/pull/2439) _(by stdlib-bot, Athan Reines)_ - [`377403b`](https://github.com/stdlib-js/stdlib/commit/377403b1ecb696a54e038b8750efd09481fe3ba0) - **test:** add missing tests for `math/base/special/cosd` [(#2418)](https://github.com/stdlib-js/stdlib/pull/2418) _(by Gunj Joshi)_ - [`c88dbaa`](https://github.com/stdlib-js/stdlib/commit/c88dbaaf68dd67dc5bdd7bb71ef9ed4ad01ef42a) - **test:** add missing tests for `math/base/special/tand` [(#2417)](https://github.com/stdlib-js/stdlib/pull/2417) _(by Gunj Joshi)_ diff --git a/base/special/trunc2/README.md b/base/special/trunc2/README.md index 08e51c3d9..0d6a93a88 100644 --- a/base/special/trunc2/README.md +++ b/base/special/trunc2/README.md @@ -101,6 +101,91 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/trunc2.h" +``` + +#### stdlib_base_trunc2( x ) + +Rounds a `numeric` value to the nearest power of two toward zero. + +```c +double y = stdlib_base_trunc2( -4.2 ); +// returns -4.0 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_trunc2( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/trunc2.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_trunc2( x[ i ] ); + printf( "trunc2(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +