diff --git a/CHANGELOG.md b/CHANGELOG.md index 75c93170c..b9098ec9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4405,6 +4405,28 @@ A total of 2 issues were closed in this release: +
+ +#### [@stdlib/math/base/special/trunc10](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/trunc10) + +
+ +
+ +##### Features + +- [`581f5a0`](https://github.com/stdlib-js/stdlib/commit/581f5a0dd601746dbf6366d073dcc391efc601d7) - add C implementation for `math/base/special/trunc10` [(##2451)](#2451) + +
+ + + +
+ +
+ + +
#### [@stdlib/math/base/special/trunc2](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/trunc2) @@ -4834,6 +4856,7 @@ A total of 29 people contributed to this release. Thank you to the following con
+- [`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)_ - [`50d806d`](https://github.com/stdlib-js/stdlib/commit/50d806dd22dd25a6f6f2900bb5a8ccc0ed7ef232) - **test:** add missing test for `math/base/special/cotd` [(#2449)](https://github.com/stdlib-js/stdlib/pull/2449) _(by Gunj Joshi)_ - [`c9ab1f2`](https://github.com/stdlib-js/stdlib/commit/c9ab1f2313cac54672d24e82665a13ff37b79a93) - **feat:** add C implementation for `math/base/special/cotd` [(##2443)](#2443) _(by Gunj Joshi)_ diff --git a/base/special/trunc10/README.md b/base/special/trunc10/README.md index 02f250551..04810f205 100644 --- a/base/special/trunc10/README.md +++ b/base/special/trunc10/README.md @@ -116,6 +116,91 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/trunc10.h" +``` + +#### stdlib_base_trunc10( x ) + +Rounds a `numeric` value to the nearest power of 10 toward zero. + +```c +double y = stdlib_base_trunc10( -4.2 ); +// returns -1.0 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_trunc10( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/trunc10.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_trunc10( x[ i ] ); + printf( "trunc10(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +