Skip to content

Commit 69de5dc

Browse files
authored
update benchmark.js
Signed-off-by: Harsh <[email protected]>
1 parent bfd85da commit 69de5dc

File tree

1 file changed

+7
-7
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/benchmark

1 file changed

+7
-7
lines changed

lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/benchmark/benchmark.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,24 @@ bench( pkg, function benchmark( b ) {
6363
bench( pkg+':factory', function benchmark( b ) {
6464
var myquantile;
6565
var gamma;
66-
var len;
66+
var opts;
6767
var x0;
6868
var p;
6969
var y;
7070
var i;
7171

72+
opts = {
73+
'dtype': 'float64'
74+
};
75+
p = uniform( 100, 0.0, 1.0, opts );
76+
7277
x0 = 0.0;
7378
gamma = 1.5;
7479
myquantile = quantile.factory( x0, gamma );
75-
len = 100;
76-
p = new Float64Array( len );
77-
for ( i = 0; i < len; i++ ) {
78-
p[ i ] = uniform( 0.0, 1.0 );
79-
}
8080

8181
b.tic();
8282
for ( i = 0; i < b.iterations; i++ ) {
83-
y = myquantile( p[ i % len ] );
83+
y = myquantile( p[ i % p.length ] );
8484
if ( isnan( y ) ) {
8585
b.fail( 'should not return NaN' );
8686
}

0 commit comments

Comments
 (0)