Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions lib/node_modules/@stdlib/math/base/special/rcbrtf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,16 @@ v = rcbrtf( Infinity );
<!-- eslint no-undef: "error" -->

```javascript
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var rcbrtf = require( '@stdlib/math/base/special/rcbrtf' );

var x;
var i;
for ( i = 0; i < 100; i++ ) {
x = discreteUniform( 0.0, 100.0 );
console.log( 'rcbrtf(%d) = %d', x, rcbrtf( x ) );
}
var opts = {
'dtype': 'float32'
};
var x = discreteUniform( 100, 0, 100, opts );

logEachMap( 'rcbrtf(%d) = %0.4f', x, rcbrtf );
```

</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@

'use strict';

var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var rcbrtf = require( './../lib' );

var x;
var i;
for ( i = 0; i < 100; i++ ) {
x = discreteUniform( 0.0, 100.0 );
console.log( 'rcbrtf(%d) = %d', x, rcbrtf( x ) );
}
var opts = {
'dtype': 'float32'
};
var x = discreteUniform( 100, 0, 100, opts );

logEachMap( 'rcbrtf(%d) = %0.4f', x, rcbrtf );
14 changes: 7 additions & 7 deletions lib/node_modules/@stdlib/math/base/special/round/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ v = round( NaN );
<!-- eslint no-undef: "error" -->

```javascript
var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var round = require( '@stdlib/math/base/special/round' );

var x;
var i;
var opts = {
'dtype': 'float64'
};
var x = uniform( 100, -50.0, 50.0, opts );

for ( i = 0; i < 100; i++ ) {
x = (randu()*100.0) - 50.0;
console.log( 'Value: %d. Rounded: %d.', x, round( x ) );
}
logEachMap( 'Value: %0.4f. Rounded: %0.4f.', x, round );
```

</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

'use strict';

var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var round = require( './../lib' );

var x;
var i;
var opts = {
'dtype': 'float64'
};
var x = uniform( 100, -50.0, 50.0, opts );

for ( i = 0; i < 100; i++ ) {
x = (randu()*100.0) - 50.0;
console.log( 'Value: %d. Rounded: %d.', x, round( x ) );
}
logEachMap( 'Value: %0.4f. Rounded: %0.4f.', x, round );
16 changes: 7 additions & 9 deletions lib/node_modules/@stdlib/math/base/special/round10/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,16 @@ v = round10( NaN );
<!-- eslint no-undef: "error" -->

```javascript
var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var round10 = require( '@stdlib/math/base/special/round10' );

var x;
var v;
var i;
var opts = {
'dtype': 'float64'
};
var x = uniform( 100, -50.0, 50.0, opts );

for ( i = 0; i < 100; i++ ) {
x = (randu()*100.0) - 50.0;
v = round10( x );
console.log( 'Value: %d. Rounded: %d.', x, v );
}
logEachMap( 'x: %0.4f. Rounded: %0.4f.', x, round10 );
```

</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@

'use strict';

var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var round10 = require( './../lib' );

var x;
var v;
var i;
var opts = {
'dtype': 'float64'
};
var x = uniform( 100, -50.0, 50.0, opts );

for ( i = 0; i < 100; i++ ) {
x = (randu()*100.0) - 50.0;
v = round10( x );
console.log( 'x: %d. Rounded: %d.', x, v );
}
logEachMap( 'x: %0.4f. Rounded: %0.4f.', x, round10 );
16 changes: 7 additions & 9 deletions lib/node_modules/@stdlib/math/base/special/round2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,16 @@ v = round2( NaN );
<!-- eslint no-undef: "error" -->

```javascript
var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var round2 = require( '@stdlib/math/base/special/round2' );

var x;
var v;
var i;
var opts = {
'dtype': 'float64'
};
var x = uniform( 100, -50.0, 50.0, opts );

for ( i = 0; i < 100; i++ ) {
x = (randu()*100.0) - 50.0;
v = round2( x );
console.log( 'Value: %d. Rounded: %d.', x, v );
}
logEachMap( 'x: %0.4f. Rounded: %0.4f.', x, round2 );
```

</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@

'use strict';

var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var round2 = require( './../lib' );

var x;
var v;
var i;
var opts = {
'dtype': 'float64'
};
var x = uniform( 100, -50.0, 50.0, opts );

for ( i = 0; i < 100; i++ ) {
x = (randu()*100.0) - 50.0;
v = round2( x );
console.log( 'x: %d. Rounded: %d.', x, v );
}
logEachMap( 'x: %0.4f. Rounded: %0.4f.', x, round2 );
14 changes: 7 additions & 7 deletions lib/node_modules/@stdlib/math/base/special/roundf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ v = roundf( NaN );
<!-- eslint no-undef: "error" -->

```javascript
var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var roundf = require( '@stdlib/math/base/special/roundf' );

var x;
var i;
var opts = {
'dtype': 'float32'
};
var x = uniform( 100, -50.0, 50.0, opts );

for ( i = 0; i < 100; i++ ) {
x = ( randu() * 100.0 ) - 50.0;
console.log( 'Value: %d. Rounded: %d.', x, roundf( x ) );
}
logEachMap( 'Value: %0.4f. Rounded: %0.4f.', x, roundf );
```

</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

'use strict';

var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var roundf = require( './../lib' );

var x;
var i;
var opts = {
'dtype': 'float32'
};
var x = uniform( 100, -50.0, 50.0, opts );

for ( i = 0; i < 100; i++ ) {
x = ( randu() * 100.0) - 50.0;
console.log( 'Value: %d. Rounded: %d.', x, roundf( x ) );
}
logEachMap( 'Value: %0.4f. Rounded: %0.4f.', x, roundf );
20 changes: 9 additions & 11 deletions lib/node_modules/@stdlib/math/base/special/roundn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,18 @@ v = roundn( 12368.0, 3 );
<!-- eslint no-undef: "error" -->

```javascript
var randu = require( '@stdlib/random/base/randu' );
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var roundn = require( '@stdlib/math/base/special/roundn' );

var x;
var n;
var v;
var i;
var opts = {
'dtype': 'float64'
};
var x = uniform( 100, -50.0, 50.0, opts );
var n = discreteUniform( 100, -5, 0, opts );

for ( i = 0; i < 100; i++ ) {
x = (randu()*100.0) - 50.0;
n = roundn( randu()*5.0, 0 );
v = roundn( x, -n );
console.log( 'x: %d. Number of decimals: %d. Rounded: %d.', x, n, v );
}
logEachMap( 'x: %0.4f. Number of decimals: %d. Rounded: %0.4f.', x, n, roundn );
```

</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,15 @@

'use strict';

var randu = require( '@stdlib/random/base/randu' );
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var roundn = require( './../lib' );

var x;
var n;
var v;
var i;
var opts = {
'dtype': 'float64'
};
var x = uniform( 100, -50.0, 50.0, opts );
var n = discreteUniform( 100, -5, 0, opts );

for ( i = 0; i < 100; i++ ) {
x = (randu()*100.0) - 50.0;
n = roundn( randu()*5.0, 0 );
v = roundn( x, -n );
console.log( 'x: %d. Number of decimals: %d. Rounded: %d.', x, n, v );
}
logEachMap( 'x: %0.4f. Number of decimals: %d. Rounded: %0.4f.', x, n, roundn );