From e4b6f0a5933cd9b3ebcc30eecc56c3e93ceeff74 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 4 Jul 2024 02:59:32 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 25 ++- base/special/floor2/README.md | 85 +++++++++ .../floor2/benchmark/benchmark.native.js | 60 ++++++ .../floor2/benchmark/c/native/Makefile | 146 +++++++++++++++ .../floor2/benchmark/c/native/benchmark.c | 136 ++++++++++++++ base/special/floor2/binding.gyp | 170 +++++++++++++++++ base/special/floor2/examples/c/Makefile | 146 +++++++++++++++ base/special/floor2/examples/c/example.c | 31 +++ base/special/floor2/include.gypi | 53 ++++++ .../include/stdlib/math/base/special/floor2.h | 41 ++++ base/special/floor2/lib/native.js | 54 ++++++ base/special/floor2/manifest.json | 102 ++++++++++ base/special/floor2/src/Makefile | 70 +++++++ base/special/floor2/src/addon.c | 22 +++ base/special/floor2/src/main.c | 73 ++++++++ base/special/floor2/test/test.native.js | 176 ++++++++++++++++++ 16 files changed, 1389 insertions(+), 1 deletion(-) create mode 100644 base/special/floor2/benchmark/benchmark.native.js create mode 100644 base/special/floor2/benchmark/c/native/Makefile create mode 100644 base/special/floor2/benchmark/c/native/benchmark.c create mode 100644 base/special/floor2/binding.gyp create mode 100644 base/special/floor2/examples/c/Makefile create mode 100644 base/special/floor2/examples/c/example.c create mode 100644 base/special/floor2/include.gypi create mode 100644 base/special/floor2/include/stdlib/math/base/special/floor2.h create mode 100644 base/special/floor2/lib/native.js create mode 100644 base/special/floor2/manifest.json create mode 100644 base/special/floor2/src/Makefile create mode 100644 base/special/floor2/src/addon.c create mode 100644 base/special/floor2/src/main.c create mode 100644 base/special/floor2/test/test.native.js 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 ); + } +} +``` + +
+ + + +
+ + +