File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
lib/node_modules/@stdlib/random/base/t/benchmark Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ bench( pkg, function benchmark( b ) {
5151 b . end ( ) ;
5252} ) ;
5353
54- bench ( pkg + ':factory' , function benchmark ( b ) {
54+ bench ( pkg + ':: factory' , function benchmark ( b ) {
5555 var rand ;
5656 var v ;
5757 var z ;
@@ -74,3 +74,27 @@ bench( pkg+':factory', function benchmark( b ) {
7474 b . pass ( 'benchmark finished' ) ;
7575 b . end ( ) ;
7676} ) ;
77+
78+ bench ( pkg + '::factory,arguments' , function benchmark ( b ) {
79+ var rand ;
80+ var v ;
81+ var z ;
82+ var i ;
83+
84+ v = 10.0 ;
85+ rand = t . factory ( ) ;
86+
87+ b . tic ( ) ;
88+ for ( i = 0 ; i < b . iterations ; i ++ ) {
89+ z = rand ( v ) ;
90+ if ( isnan ( z ) ) {
91+ b . fail ( 'should not return NaN' ) ;
92+ }
93+ }
94+ b . toc ( ) ;
95+ if ( isnan ( z ) ) {
96+ b . fail ( 'should not return NaN' ) ;
97+ }
98+ b . pass ( 'benchmark finished' ) ;
99+ b . end ( ) ;
100+ } ) ;
You can’t perform that action at this time.
0 commit comments