Skip to content

Commit 7e2791e

Browse files
Apply suggestions from code review
Co-authored-by: Gunj Joshi <[email protected]> Signed-off-by: Harsh Mathur <[email protected]>
1 parent 0d18ce7 commit 7e2791e

File tree

1 file changed

+5
-8
lines changed
  • lib/node_modules/@stdlib/math/base/special/lcmf/benchmark

1 file changed

+5
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
25-
var roundf = require( '@stdlib/math/base/special/roundf' );
26-
var isnan = require( '@stdlib/math/base/assert/is-nan' );
24+
var randu = require( '@stdlib/random/array/discrete-uniform' );
25+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2726
var pkg = require( './../package.json' ).name;
2827
var lcmf = require( './../lib' );
2928

@@ -38,15 +37,13 @@ bench( pkg, function benchmark( b ) {
3837

3938
b.tic();
4039
for ( i = 0; i < b.iterations; i++ ) {
41-
x = roundf( randu() * 50.0 );
42-
y = roundf( randu() * 50.0 );
43-
z = lcmf( x, y );
44-
if ( isnan( z ) ) {
40+
z = lcmf( x[ i % x.length ], y[ i % y.length ] );
41+
if ( isnanf( z ) ) {
4542
b.fail( 'should not return NaN' );
4643
}
4744
}
4845
b.toc();
49-
if ( isnan( z ) ) {
46+
if ( isnanf( z ) ) {
5047
b.fail( 'should not return NaN' );
5148
}
5249
b.pass( 'benchmark finished' );

0 commit comments

Comments
 (0)