Skip to content

Commit 3a51110

Browse files
committed
benchmark.native.js update
1 parent fcedb34 commit 3a51110

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/node_modules/@stdlib/math/base/special/minmax/benchmark/benchmark.native.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,20 @@ var opts = {
4141
bench( pkg+'::native', opts, function benchmark( b ) {
4242
var x;
4343
var y;
44+
var v;
4445
var i;
4546

4647
b.tic();
4748
for ( i = 0; i < b.iterations; i++ ) {
4849
x = ( randu() * 20.0 ) - 10.0;
49-
y = minmax( x );
50-
if ( isnan( y ) ) {
50+
y = ( randu() * 20.0 ) - 10.0;
51+
v = minmax( x, y );
52+
if ( isnan( v[0] ) || isnan( v[1] )) {
5153
b.fail( 'should not return NaN' );
5254
}
5355
}
5456
b.toc();
55-
if ( isnan( y ) ) {
57+
if ( isnan( v[0] ) || isnan( v[1] ) ) {
5658
b.fail( 'should not return NaN' );
5759
}
5860
b.pass( 'benchmark finished' );

0 commit comments

Comments
 (0)