diff --git a/lib/node_modules/@stdlib/math/base/special/round/README.md b/lib/node_modules/@stdlib/math/base/special/round/README.md index 0cc1505c2cf1..33ce72aa34f0 100644 --- a/lib/node_modules/@stdlib/math/base/special/round/README.md +++ b/lib/node_modules/@stdlib/math/base/special/round/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2018 The Stdlib Authors. +Copyright (c) 2022 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -106,6 +106,96 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/round.h" +``` + +#### stdlib_base_round( x ) + +Rounds a `numeric` value to the nearest `integer`. + +```c +double out = stdlib_base_round( 3.14 ); +// returns 3.0 + +out = stdlib_base_round( -4.2 ); +// returns -4.0 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_round( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/round.h" +#include +#include + +int main() { + double x; + double v; + int i; + + for ( i = 0; i < 100; i++ ) { + x = ( ( (double)rand() / (double)RAND_MAX ) * 100.0 ) - 50.0; + v = stdlib_base_round( x ); + printf( "Value: %lf. Rounded: %lf.\n", x, v ); + } +} +``` + +
+ + + +
+ + +