Skip to content

Commit 5d37de2

Browse files
authored
docs: update style and examples
PR-URL: #2189 Reviewed-by: Athan Reines <kgryte@gmail.com> Signed-off-by: GUNJ JOSHI <gunjjoshi8372@gmail.com>
1 parent 8c0fc7e commit 5d37de2

File tree

10 files changed

+166
-175
lines changed

10 files changed

+166
-175
lines changed

lib/node_modules/@stdlib/math/base/special/rcbrt/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ limitations under the License.
1818
1919
-->
2020

21-
# Reciprocal Cube Root
21+
# rcbrt
2222

2323
> Compute the reciprocal of the principal [cube root][cube-root] of a double-precision floating-point number.
2424
@@ -86,15 +86,13 @@ v = rcbrt( Infinity );
8686
<!-- eslint no-undef: "error" -->
8787

8888
```javascript
89-
var randu = require( '@stdlib/random/base/randu' );
90-
var round = require( '@stdlib/math/base/special/round' );
89+
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
9190
var rcbrt = require( '@stdlib/math/base/special/rcbrt' );
9291

9392
var x;
9493
var i;
95-
9694
for ( i = 0; i < 100; i++ ) {
97-
x = round( randu() * 100.0 );
95+
x = discreteUniform( 0.0, 100.0 );
9896
console.log( 'rcbrt(%d) = %d', x, rcbrt( x ) );
9997
}
10098
```

lib/node_modules/@stdlib/math/base/special/rcbrt/benchmark/benchmark.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ bench( pkg, function benchmark( b ) {
4343

4444
b.tic();
4545
for ( i = 0; i < b.iterations; i++ ) {
46-
x = ( randu()*100000.0 ) - 0.0;
46+
x = ( randu() * 100000.0 ) - 0.0;
4747
y = rcbrt( x );
4848
if ( isnan( y ) ) {
4949
b.fail( 'should not return NaN' );
@@ -64,7 +64,7 @@ bench( pkg+'::built-in', opts, function benchmark( b ) {
6464

6565
b.tic();
6666
for ( i = 0; i < b.iterations; i++ ) {
67-
x = ( randu()*100000.0 ) - 0.0;
67+
x = ( randu() * 100000.0 ) - 0.0;
6868
y = 1.0 / Math.cbrt( x ); // eslint-disable-line stdlib/no-builtin-math
6969
if ( isnan( y ) ) {
7070
b.fail( 'should not return NaN' );

lib/node_modules/@stdlib/math/base/special/rcbrt/benchmark/benchmark.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4545

4646
b.tic();
4747
for ( i = 0; i < b.iterations; i++ ) {
48-
x = ( randu()*100000.0 ) - 0.0;
48+
x = ( randu() * 100000.0 ) - 0.0;
4949
y = rcbrt( x );
5050
if ( isnan( y ) ) {
5151
b.fail( 'should not return NaN' );

lib/node_modules/@stdlib/math/base/special/rcbrt/docs/repl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
0.1
2222
> y = {{alias}}( 0.0 )
2323
Infinity
24-
> y = {{alias}}( Infinity )
24+
> y = {{alias}}( {{alias:@stdlib/constants/float64/pinf}} )
2525
0.0
2626
> y = {{alias}}( -8.0 )
2727
-0.5

lib/node_modules/@stdlib/math/base/special/rcbrt/examples/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@
1818

1919
'use strict';
2020

21-
var randu = require( '@stdlib/random/base/randu' );
22-
var round = require( '@stdlib/math/base/special/round' );
21+
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
2322
var rcbrt = require( './../lib' );
2423

2524
var x;
2625
var i;
27-
2826
for ( i = 0; i < 100; i++ ) {
29-
x = round( randu() * 100.0 );
27+
x = discreteUniform( 0.0, 100.0 );
3028
console.log( 'rcbrt(%d) = %d', x, rcbrt( x ) );
3129
}

lib/node_modules/@stdlib/math/base/special/rcbrt/manifest.json

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@
2828
{
2929
"task": "build",
3030
"src": [
31-
"./src/rcbrt.c"
31+
"./src/main.c"
3232
],
3333
"include": [
3434
"./include"
3535
],
36-
"libraries": [
37-
"-lm"
38-
],
36+
"libraries": [],
3937
"libpath": [],
4038
"dependencies": [
4139
"@stdlib/math/base/napi/unary",
@@ -45,14 +43,12 @@
4543
{
4644
"task": "benchmark",
4745
"src": [
48-
"./src/rcbrt.c"
46+
"./src/main.c"
4947
],
5048
"include": [
5149
"./include"
5250
],
53-
"libraries": [
54-
"-lm"
55-
],
51+
"libraries": [],
5652
"libpath": [],
5753
"dependencies": [
5854
"@stdlib/math/base/special/cbrt"
@@ -61,14 +57,12 @@
6157
{
6258
"task": "examples",
6359
"src": [
64-
"./src/rcbrt.c"
60+
"./src/main.c"
6561
],
6662
"include": [
6763
"./include"
6864
],
69-
"libraries": [
70-
"-lm"
71-
],
65+
"libraries": [],
7266
"libpath": [],
7367
"dependencies": [
7468
"@stdlib/math/base/special/cbrt"

lib/node_modules/@stdlib/math/base/special/rcbrt/src/addon.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
#include "stdlib/math/base/special/rcbrt.h"
2020
#include "stdlib/math/base/napi/unary.h"
2121

22+
// cppcheck-suppress shadowFunction
2223
STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_rcbrt )

lib/node_modules/@stdlib/math/base/special/rcbrt/src/rcbrt.c renamed to lib/node_modules/@stdlib/math/base/special/rcbrt/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
/**
2323
* Computes the reciprocal cube root of a double-precision floating-point number.
2424
*
25-
* @param x number
26-
* @return reciprocal cube root
25+
* @param x number
26+
* @return reciprocal cube root
2727
*
2828
* @example
2929
* double y = stdlib_base_rcbrt( 8.0 );

0 commit comments

Comments
 (0)