File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
lib/node_modules/@stdlib/random/base/f/benchmark Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ bench( pkg, function benchmark( b ) {
5353 b . end ( ) ;
5454} ) ;
5555
56- bench ( pkg + ':factory' , function benchmark ( b ) {
56+ bench ( pkg + ':: factory' , function benchmark ( b ) {
5757 var rand ;
5858 var d1 ;
5959 var d2 ;
@@ -78,3 +78,29 @@ bench( pkg+':factory', function benchmark( b ) {
7878 b . pass ( 'benchmark finished' ) ;
7979 b . end ( ) ;
8080} ) ;
81+
82+ bench ( pkg + '::factory,arguments' , function benchmark ( b ) {
83+ var rand ;
84+ var d1 ;
85+ var d2 ;
86+ var z ;
87+ var i ;
88+
89+ d1 = 1.5 ;
90+ d2 = 1.5 ;
91+ rand = f . factory ( ) ;
92+
93+ b . tic ( ) ;
94+ for ( i = 0 ; i < b . iterations ; i ++ ) {
95+ z = rand ( d1 , d2 ) ;
96+ if ( isnan ( z ) ) {
97+ b . fail ( 'should not return NaN' ) ;
98+ }
99+ }
100+ b . toc ( ) ;
101+ if ( isnan ( z ) ) {
102+ b . fail ( 'should not return NaN' ) ;
103+ }
104+ b . pass ( 'benchmark finished' ) ;
105+ b . end ( ) ;
106+ } ) ;
You can’t perform that action at this time.
0 commit comments