diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/benchmark.js index d5061d40a1d4..9db05e53e37a 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var pkg = require( './../package.json' ).name; var isNegativeZero = require( './../lib' ); @@ -30,14 +30,19 @@ var isNegativeZero = require( './../lib' ); // MAIN // bench( pkg, function benchmark( b ) { + var opts; var x; var y; var i; + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, -5.0e6, 5.0e6, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = isNegativeZero( x ); + y = isNegativeZero( x[ i%x.length ] ); if ( typeof y !== 'boolean' ) { b.fail( 'should return a boolean' ); } diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/benchmark.native.js index a0e5bf8bac09..5f00ff43e8f4 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -39,14 +39,19 @@ var opts = { // MAIN // bench( pkg+'::native', opts, function benchmark( b ) { + var opts; var x; var y; var i; + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, -5.0e6, 5.0e6, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = isNegativeZero( x ); + y = isNegativeZero( x[ i%x.length ] ); if ( typeof y !== 'boolean' ) { b.fail( 'should return a boolean' ); } diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/c/benchmark.c index c808eae286b5..2952ed5907c8 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/c/benchmark.c @@ -101,15 +101,18 @@ bool is_negative_zero( double x ) { */ static double benchmark( void ) { double elapsed; - double x; + double x[ 100 ]; double t; bool y; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 1.0e7*rand_double() ) - 5.0e6; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1.0e7*rand_double() ) - 5.0e6; - y = is_negative_zero( x ); + y = is_negative_zero( x[ i%100 ] ); if ( y != true && y != false ) { printf( "should return true or false\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/c/native/benchmark.c index 0b45055b0157..93eb5f826a75 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/benchmark/c/native/benchmark.c @@ -92,15 +92,18 @@ static double rand_double( void ) { */ static double benchmark( void ) { double elapsed; - double x; + double x[ 100 ]; double t; bool b; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 1.0e7*rand_double() ) - 5.0e6; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = (rand_double()*1.0e7) - 5.0e6; - b = stdlib_base_is_negative_zero( x ); + b = stdlib_base_is_negative_zero( x[ i%100 ] ); if ( b != true && b != false ) { printf( "should return either true or false\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/test/test.js b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/test/test.js index 5239d466a26a..e6028d02230e 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/test/test.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/test/test.js @@ -33,12 +33,12 @@ tape( 'main export is a function', function test( t ) { }); tape( 'the function returns `true` if provided `-0`', function test( t ) { - t.equal( isNegativeZero( -0.0 ), true, 'returns true' ); + t.equal( isNegativeZero( -0.0 ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `+0`', function test( t ) { - t.equal( isNegativeZero( +0.0 ), false, 'returns false' ); + t.equal( isNegativeZero( +0.0 ), false, 'returns expected value' ); t.end(); }); @@ -61,7 +61,7 @@ tape( 'the function returns `false` if not provided `-0`', function test( t ) { ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isNegativeZero( values[i] ), false, 'returns false if provided ' + values[ i ] ); + t.equal( isNegativeZero( values[i] ), false, 'returns expected value if provided ' + values[ i ] ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/test/test.native.js b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/test/test.native.js index 900988d94cbd..5d8be4954a2f 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zero/test/test.native.js @@ -42,12 +42,12 @@ tape( 'main export is a function', opts, function test( t ) { }); tape( 'the function returns `true` if provided `-0`', opts, function test( t ) { - t.equal( isNegativeZero( -0.0 ), true, 'returns true' ); + t.equal( isNegativeZero( -0.0 ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `+0`', opts, function test( t ) { - t.equal( isNegativeZero( +0.0 ), false, 'returns false' ); + t.equal( isNegativeZero( +0.0 ), false, 'returns expected value' ); t.end(); }); @@ -70,7 +70,7 @@ tape( 'the function returns `false` if not provided `-0`', opts, function test( ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isNegativeZero( values[i] ), false, 'returns false if provided ' + values[ i ] ); + t.equal( isNegativeZero( values[i] ), false, 'returns expected value if provided ' + values[ i ] ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/benchmark.js index f0bbe57f16f6..197d26c89acf 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var pkg = require( './../package.json' ).name; var isNegativeZerof = require( './../lib' ); @@ -30,14 +30,19 @@ var isNegativeZerof = require( './../lib' ); // MAIN // bench( pkg, function benchmark( b ) { + var opts; var x; var y; var i; + opts = { + 'dtype': 'float32' + }; + x = uniform( 100, -50.0, 50.0, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*100.0 ) - 50.0; - y = isNegativeZerof( x ); + y = isNegativeZerof( x[ i%x.length ] ); if ( typeof y !== 'boolean' ) { b.fail( 'should return a boolean' ); } diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/benchmark.native.js index af927d791b5f..7a48d393308d 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -39,14 +39,19 @@ var opts = { // MAIN // bench( pkg+'::native', opts, function benchmark( b ) { + var opts; var x; var y; var i; + opts = { + 'dtype': 'float32' + }; + x = uniform( 100, -50.0, 50.0, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*100.0 ) - 50.0; - y = isNegativeZerof( x ); + y = isNegativeZerof( x[ i%x.length ] ); if ( typeof y !== 'boolean' ) { b.fail( 'should return a boolean' ); } diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/c/benchmark.c index 99b163243f32..660b7d9066d2 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/c/benchmark.c @@ -101,15 +101,18 @@ bool is_negative_zerof( float x ) { */ static double benchmark( void ) { double elapsed; + float x[ 100 ]; double t; - float x; bool y; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 100.0f*rand_float() ) - 50.0f; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 100.0f*rand_float() ) - 50.0f; - y = is_negative_zerof( x ); + y = is_negative_zerof( x[ i%100 ] ); if ( y != true && y != false ) { printf( "should return true or false\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/c/native/benchmark.c index 871fafb3c1cb..0dc13c13250d 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/benchmark/c/native/benchmark.c @@ -92,15 +92,18 @@ static float rand_float( void ) { */ static double benchmark( void ) { double elapsed; + float x[ 100 ]; double t; - float x; bool b; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 100.0f*rand_float() ) - 50.0f; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = (rand_float()*100.0f) - 50.0f; - b = stdlib_base_is_negative_zerof( x ); + b = stdlib_base_is_negative_zerof( x[ i%100 ] ); if ( b != true && b != false ) { printf( "should return either true or false\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/test/test.js b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/test/test.js index 45e7fcaa7d25..7989ef6601fe 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/test/test.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/test/test.js @@ -33,13 +33,13 @@ tape( 'main export is a function', function test( t ) { }); tape( 'the function returns `true` if provided `-0`', function test( t ) { - t.equal( isNegativeZerof( -0.0 ), true, 'returns true' ); + t.equal( isNegativeZerof( -0.0 ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `+0`', function test( t ) { - t.equal( isNegativeZerof( 0.0 ), false, 'returns false' ); - t.equal( isNegativeZerof( +0.0 ), false, 'returns false' ); + t.equal( isNegativeZerof( 0.0 ), false, 'returns expected value' ); + t.equal( isNegativeZerof( +0.0 ), false, 'returns expected value' ); t.end(); }); @@ -62,7 +62,7 @@ tape( 'the function returns `false` if not provided `-0`', function test( t ) { ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isNegativeZerof( values[i] ), false, 'returns false when provided ' + values[ i ] ); + t.equal( isNegativeZerof( values[i] ), false, 'returns expected value when provided ' + values[ i ] ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/test/test.native.js b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/test/test.native.js index 885168c3cf1d..9eb3513e96ce 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-negative-zerof/test/test.native.js @@ -42,13 +42,13 @@ tape( 'main export is a function', opts, function test( t ) { }); tape( 'the function returns `true` if provided `-0`', opts, function test( t ) { - t.equal( isNegativeZerof( -0.0 ), true, 'returns true' ); + t.equal( isNegativeZerof( -0.0 ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `+0`', opts, function test( t ) { - t.equal( isNegativeZerof( 0.0 ), false, 'returns false' ); - t.equal( isNegativeZerof( +0.0 ), false, 'returns false' ); + t.equal( isNegativeZerof( 0.0 ), false, 'returns expected value' ); + t.equal( isNegativeZerof( +0.0 ), false, 'returns expected value' ); t.end(); }); @@ -71,7 +71,7 @@ tape( 'the function returns `false` if not provided `-0`', opts, function test( ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isNegativeZerof( values[i] ), false, 'returns false when provided ' + values[ i ] ); + t.equal( isNegativeZerof( values[i] ), false, 'returns expected value when provided ' + values[ i ] ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/benchmark/benchmark.js index 74d7a76ce1d9..576160cc9470 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var pkg = require( './../package.json' ).name; var isNonNegativeFinite = require( './../lib' ); @@ -30,14 +30,19 @@ var isNonNegativeFinite = require( './../lib' ); // MAIN // bench( pkg, function benchmark( b ) { + var opts; var x; var y; var i; + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, -100.0, 100.0, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = (randu()*200.0) - 100.0; - y = isNonNegativeFinite( x ); + y = isNonNegativeFinite( x[ i%x.length ] ); if ( typeof y !== 'boolean' ) { b.fail( 'should return a boolean' ); } diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/benchmark/benchmark.native.js index 8397b973a7ba..a07a22cdbd20 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -39,14 +39,19 @@ var opts = { // MAIN // bench( pkg+'::native', opts, function benchmark( b ) { + var opts; var x; var y; var i; + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, -100.0, 100.0, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*200.0 ) - 100.0; - y = isNonNegativeFinite( x ); + y = isNonNegativeFinite( x[ i%x.length ] ); if ( typeof y !== 'boolean' ) { b.fail( 'should return a boolean' ); } diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/benchmark/c/native/benchmark.c index 29bc3949f4bf..0485850950f4 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/benchmark/c/native/benchmark.c @@ -92,15 +92,18 @@ static double rand_double( void ) { */ static double benchmark( void ) { double elapsed; - double x; + double x[ 100 ]; double t; bool b; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( rand_double() * 200.0 ) - 100.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( rand_double() * 200.0 ) - 100.0; - b = stdlib_base_is_nonnegative_finite( x ); + b = stdlib_base_is_nonnegative_finite( x[ i%100 ] ); if ( b != true && b != false ) { printf( "should return either true or false\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/test/test.js b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/test/test.js index ec0c1447f11e..6d28f5e2db26 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/test/test.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/test/test.js @@ -46,7 +46,7 @@ tape( 'the function returns `true` if provided a nonnegative finite number', fun ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isNonNegativeFinite( values[ i ] ), true, 'returns true when provided ' + values[ i ] ); + t.equal( isNonNegativeFinite( values[ i ] ), true, 'returns expected value when provided ' + values[ i ] ); } t.end(); }); @@ -63,7 +63,7 @@ tape( 'the function returns `false` if not provided a nonnegative finite number' ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isNonNegativeFinite( values[ i ] ), false, 'returns false when provided ' + values[ i ] ); + t.equal( isNonNegativeFinite( values[ i ] ), false, 'returns expected value when provided ' + values[ i ] ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/test/test.native.js b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/test/test.native.js index 2aaffe5b2654..f83c649d3b8d 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-nonnegative-finite/test/test.native.js @@ -55,7 +55,7 @@ tape( 'the function returns `true` if provided a nonnegative finite number', opt ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isNonNegativeFinite( values[ i ] ), true, 'returns true when provided ' + values[ i ] ); + t.equal( isNonNegativeFinite( values[ i ] ), true, 'returns expected value when provided ' + values[ i ] ); } t.end(); }); @@ -72,7 +72,7 @@ tape( 'the function returns `false` if not provided a nonnegative finite number' ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isNonNegativeFinite( values[ i ] ), false, 'returns false when provided ' + values[ i ] ); + t.equal( isNonNegativeFinite( values[ i ] ), false, 'returns expected value when provided ' + values[ i ] ); } t.end(); });