diff --git a/lib/node_modules/@stdlib/math/base/special/truncn/README.md b/lib/node_modules/@stdlib/math/base/special/truncn/README.md index 0e6b9b1df5d2..04e960cf0457 100644 --- a/lib/node_modules/@stdlib/math/base/special/truncn/README.md +++ b/lib/node_modules/@stdlib/math/base/special/truncn/README.md @@ -89,6 +89,92 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/truncn.h" +``` + +#### stdlib_base_truncn( x, n ) + +Rounds a `numeric` value to the nearest multiple of `10^n` toward zero. + +```c +double y = stdlib_base_truncn( 3.141592653589793, -4 ); +// 3.1415 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **n**: `[in] int32_t` integer power of 10. + +```c +double stdlib_base_truncn( const double x, const int32_t n ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/truncn.h" +#include + +int main( void ) { + const double x[] = { 3.141592653589793, -3.141592653589793, 2.731, 3.55555 }; + + double y; + int i; + for ( i = 0; i < 4; i++ ) { + y = stdlib_base_truncn( x[ i ], -2 ); + printf( "truncn(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +