Skip to content

Commit 0f5ff12

Browse files
authored
chore: updated examples
1 parent eea596c commit 0f5ff12

File tree

1 file changed

+4
-3
lines changed
  • lib/node_modules/@stdlib/math/base/assert/is-oddf/examples

1 file changed

+4
-3
lines changed

lib/node_modules/@stdlib/math/base/assert/is-oddf/examples/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@
1818

1919
'use strict';
2020

21-
var randu = require( '@stdlib/random/base/randu' );
21+
var randu = require( '@stdlib/random/array/discrete-uniform' );
2222
var roundf = require( '@stdlib/math/base/special/roundf' );
2323
var isOddf = require( './../lib' );
2424

2525
var bool;
2626
var x;
2727
var i;
2828

29+
x = randu( 100, -50, 50 );
30+
2931
for ( i = 0; i < 100; i++ ) {
30-
x = roundf( randu() * 100.0 );
31-
bool = isOddf( x );
32+
bool = isOddf( x[ i % 100 ] );
3233
console.log( '%d is %s', x, ( bool ) ? 'odd' : 'not odd' );
3334
}

0 commit comments

Comments
 (0)