File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
lib/node_modules/@stdlib/math/base/special/lcmf/benchmark Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 2121// MODULES //
2222
2323var 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' ) ;
2726var pkg = require ( './../package.json' ) . name ;
2827var 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' ) ;
You can’t perform that action at this time.
0 commit comments