diff --git a/lib/node_modules/@stdlib/math/base/assert/is-even/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/assert/is-even/benchmark/benchmark.js index 0ea52481252f..e1cc44da21d7 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-even/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-even/benchmark/benchmark.js @@ -30,17 +30,19 @@ var isEven = require( './../lib' ); // MAIN // bench( pkg, function benchmark( b ) { - var len; + var opts; var x; var y; var i; - len = 100; - x = discreteUniform( len, 0, 1000 ); + opts = { + 'dtype': 'float64' + }; + x = discreteUniform( 100, 0, 1000, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = isEven( x[ i % len ] ); + y = isEven( 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-even/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/assert/is-even/benchmark/benchmark.native.js index b95bed88186f..e96981d99662 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-even/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-even/benchmark/benchmark.native.js @@ -39,17 +39,19 @@ var opts = { // MAIN // bench( pkg+'::native', opts, function benchmark( b ) { - var len; + var opts; var x; var y; var i; - len = 100; - x = discreteUniform( len, 0, 1000 ); + opts = { + 'dtype': 'float64' + }; + x = discreteUniform( 100, 0, 1000, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = isEven( x[ i % len ] ); + y = isEven( 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-even/test/test.js b/lib/node_modules/@stdlib/math/base/assert/is-even/test/test.js index e438a2b6e079..d88dc353b8a5 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-even/test/test.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-even/test/test.js @@ -44,7 +44,7 @@ tape( 'the function returns `true` if provided an even number', function test( t x = round( randu()*1.0e6 ) - 5.0e5; x *= 2; // always even bool = isEven( x ); - t.equal( bool, true, 'returns true when provided '+x ); + t.equal( bool, true, 'returns expected value when provided '+x ); } t.end(); }); @@ -59,29 +59,29 @@ tape( 'the function returns `false` if provided an odd number', function test( t x += 1; } bool = isEven( x ); - t.equal( bool, false, 'returns false when provided '+x ); + t.equal( bool, false, 'returns expected value when provided '+x ); } t.end(); }); tape( 'the function returns `true` if provided `+-0`', function test( t ) { - t.equal( isEven( +0.0 ), true, 'returns true' ); - t.equal( isEven( -0.0 ), true, 'returns true' ); + t.equal( isEven( +0.0 ), true, 'returns expected value' ); + t.equal( isEven( -0.0 ), true, 'returns expected value' ); t.end(); }); tape( 'WARNING: the function returns `true` if provided `+infinity`', function test( t ) { - t.equal( isEven( PINF ), true, 'returns true' ); + t.equal( isEven( PINF ), true, 'returns expected value' ); t.end(); }); tape( 'WARNING: the function returns `true` if provided `-infinity`', function test( t ) { - t.equal( isEven( NINF ), true, 'returns true' ); + t.equal( isEven( NINF ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `NaN`', function test( t ) { - t.equal( isEven( NaN ), false, 'returns false' ); - t.equal( isEven( 0.0/0.0 ), false, 'returns false' ); + t.equal( isEven( NaN ), false, 'returns expected value' ); + t.equal( isEven( 0.0/0.0 ), false, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-even/test/test.native.js b/lib/node_modules/@stdlib/math/base/assert/is-even/test/test.native.js index 561beba6fdf7..d55bb996403c 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-even/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-even/test/test.native.js @@ -53,7 +53,7 @@ tape( 'the function returns `true` if provided an even number', opts, function t x = round( randu()*1.0e6 ) - 5.0e5; x *= 2; // always even bool = isEven( x ); - t.equal( bool, true, 'returns true when provided '+x ); + t.equal( bool, true, 'returns expected value when provided '+x ); } t.end(); }); @@ -68,29 +68,29 @@ tape( 'the function returns `false` if provided an odd number', opts, function t x += 1; } bool = isEven( x ); - t.equal( bool, false, 'returns false when provided '+x ); + t.equal( bool, false, 'returns expected value when provided '+x ); } t.end(); }); tape( 'the function returns `true` if provided `+-0`', opts, function test( t ) { - t.equal( isEven( +0.0 ), true, 'returns true' ); - t.equal( isEven( -0.0 ), true, 'returns true' ); + t.equal( isEven( +0.0 ), true, 'returns expected value' ); + t.equal( isEven( -0.0 ), true, 'returns expected value' ); t.end(); }); tape( 'WARNING: the function returns `true` if provided `+infinity`', opts, function test( t ) { - t.equal( isEven( PINF ), true, 'returns true' ); + t.equal( isEven( PINF ), true, 'returns expected value' ); t.end(); }); tape( 'WARNING: the function returns `true` if provided `-infinity`', opts, function test( t ) { - t.equal( isEven( NINF ), true, 'returns true' ); + t.equal( isEven( NINF ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `NaN`', opts, function test( t ) { - t.equal( isEven( NaN ), false, 'returns false' ); - t.equal( isEven( 0.0/0.0 ), false, 'returns false' ); + t.equal( isEven( NaN ), false, 'returns expected value' ); + t.equal( isEven( 0.0/0.0 ), false, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-evenf/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/assert/is-evenf/benchmark/benchmark.js index 68637a531f74..e2807a5404e6 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-evenf/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-evenf/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/array/discrete-uniform' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var pkg = require( './../package.json' ).name; var isEvenf = require( './../lib' ); @@ -30,15 +30,19 @@ var isEvenf = require( './../lib' ); // MAIN // bench( pkg, function benchmark( b ) { + var opts; var x; var y; var i; - x = randu( 100, -50, 50 ); + opts = { + 'dtype': 'float32' + }; + x = discreteUniform( 100, -50, 50, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = isEvenf( x[ i % 100 ] ); + y = isEvenf( 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-evenf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/assert/is-evenf/benchmark/benchmark.native.js index e49faa6da646..15b71471a84e 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-evenf/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-evenf/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/array/discrete-uniform' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -39,15 +39,19 @@ var opts = { // MAIN // bench( pkg+'::native', opts, function benchmark( b ) { + var opts; var x; var y; var i; - x = randu( 100, -50, 50 ); + opts = { + 'dtype': 'float32' + }; + x = discreteUniform( 100, -50, 50, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = isEvenf( x[ i % 100 ] ); + y = isEvenf( 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-evenf/test/test.js b/lib/node_modules/@stdlib/math/base/assert/is-evenf/test/test.js index 0e481806e095..45a2fd4b88e3 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-evenf/test/test.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-evenf/test/test.js @@ -44,7 +44,7 @@ tape( 'the function returns `true` if provided an even number', function test( t x = roundf( randu() * 1.0e6 ) - 5.0e5; x *= 2; // always even bool = isEvenf( x ); - t.equal( bool, true, 'returns true when provided '+x ); + t.equal( bool, true, 'returns expected value when provided '+x ); } t.end(); }); @@ -59,29 +59,29 @@ tape( 'the function returns `false` if provided an odd number', function test( t x += 1; } bool = isEvenf( x ); - t.equal( bool, false, 'returns false when provided '+x ); + t.equal( bool, false, 'returns expected value when provided '+x ); } t.end(); }); tape( 'the function returns `true` if provided `+-0`', function test( t ) { - t.equal( isEvenf( +0.0 ), true, 'returns true' ); - t.equal( isEvenf( -0.0 ), true, 'returns true' ); + t.equal( isEvenf( +0.0 ), true, 'returns expected value' ); + t.equal( isEvenf( -0.0 ), true, 'returns expected value' ); t.end(); }); tape( 'WARNING: the function returns `true` if provided `+infinity`', function test( t ) { - t.equal( isEvenf( PINF ), true, 'returns true' ); + t.equal( isEvenf( PINF ), true, 'returns expected value' ); t.end(); }); tape( 'WARNING: the function returns `true` if provided `-infinity`', function test( t ) { - t.equal( isEvenf( NINF ), true, 'returns true' ); + t.equal( isEvenf( NINF ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `NaN`', function test( t ) { - t.equal( isEvenf( NaN ), false, 'returns false' ); - t.equal( isEvenf( 0.0 / 0.0 ), false, 'returns false' ); + t.equal( isEvenf( NaN ), false, 'returns expected value' ); + t.equal( isEvenf( 0.0 / 0.0 ), false, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-evenf/test/test.native.js b/lib/node_modules/@stdlib/math/base/assert/is-evenf/test/test.native.js index e37fd262ba06..3dbc29af5ee4 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-evenf/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-evenf/test/test.native.js @@ -53,7 +53,7 @@ tape( 'the function returns `true` if provided an even number', opts, function t x = roundf( randu() * 1.0e6 ) - 5.0e5; x *= 2; // always even bool = isEvenf( x ); - t.equal( bool, true, 'returns true when provided '+x ); + t.equal( bool, true, 'returns expected value when provided '+x ); } t.end(); }); @@ -68,29 +68,29 @@ tape( 'the function returns `false` if provided an odd number', opts, function t x += 1; } bool = isEvenf( x ); - t.equal( bool, false, 'returns false when provided '+x ); + t.equal( bool, false, 'returns expected value when provided '+x ); } t.end(); }); tape( 'the function returns `true` if provided `+-0`', opts, function test( t ) { - t.equal( isEvenf( +0.0 ), true, 'returns true' ); - t.equal( isEvenf( -0.0 ), true, 'returns true' ); + t.equal( isEvenf( +0.0 ), true, 'returns expected value' ); + t.equal( isEvenf( -0.0 ), true, 'returns expected value' ); t.end(); }); tape( 'WARNING: the function returns `true` if provided `+infinity`', opts, function test( t ) { - t.equal( isEvenf( PINF ), true, 'returns true' ); + t.equal( isEvenf( PINF ), true, 'returns expected value' ); t.end(); }); tape( 'WARNING: the function returns `true` if provided `-infinity`', opts, function test( t ) { - t.equal( isEvenf( NINF ), true, 'returns true' ); + t.equal( isEvenf( NINF ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `NaN`', opts, function test( t ) { - t.equal( isEvenf( NaN ), false, 'returns false' ); - t.equal( isEvenf( 0.0 / 0.0 ), false, 'returns false' ); + t.equal( isEvenf( NaN ), false, 'returns expected value' ); + t.equal( isEvenf( 0.0 / 0.0 ), false, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-finite/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/assert/is-finite/benchmark/benchmark.js index 5f74f4d5814b..44bb17bedd01 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finite/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-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 isfinite = require( './../lib' ); @@ -30,14 +30,19 @@ var isfinite = 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 = isfinite( x ); + y = isfinite( 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-finite/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/assert/is-finite/benchmark/benchmark.native.js index 2aa80bed258a..fded63da64e5 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finite/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-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; @@ -43,10 +43,14 @@ bench( pkg+'::native', opts, function benchmark( b ) { 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 = isfinite( x ); + y = isfinite( 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-finite/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-finite/benchmark/c/benchmark.c index 611bbbe3b4b7..261f8cc661f8 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finite/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-finite/benchmark/c/benchmark.c @@ -90,15 +90,18 @@ static double rand_double( void ) { */ static double benchmark( void ) { double elapsed; - double x; + double x[ 100 ]; double t; int 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 = isfinite( x ); + y = isfinite( x[ i%100 ] ); if ( y != 0 && y != 1 ) { printf( "should return 0 or 1\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/assert/is-finite/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-finite/benchmark/c/native/benchmark.c index 9a28bbd3e4e2..86920975c9aa 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finite/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-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()*1.0e7) - 5.0e6; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = (rand_double()*1.0e7) - 5.0e6; - b = stdlib_base_is_finite( x ); + b = stdlib_base_is_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-finite/test/test.js b/lib/node_modules/@stdlib/math/base/assert/is-finite/test/test.js index 0bee414c003e..a8706d9ebaa7 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finite/test/test.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-finite/test/test.js @@ -48,26 +48,26 @@ tape( 'the function returns `true` if provided a finite number', function test( ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isfinite( values[i] ), true, 'returns true when provided '+values[i] ); + t.equal( isfinite( values[i] ), true, 'returns expected value when provided '+values[i] ); } for ( i = -100; i < 101; i++ ) { - t.equal( isfinite( i ), true, 'returns true when provided '+i ); + t.equal( isfinite( i ), true, 'returns expected value when provided '+i ); } t.end(); }); tape( 'the function returns `false` if provided `+infinity`', function test( t ) { - t.equal( isfinite( PINF ), false, 'returns false' ); + t.equal( isfinite( PINF ), false, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `-infinity`', function test( t ) { - t.equal( isfinite( NINF ), false, 'returns false' ); + t.equal( isfinite( NINF ), false, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `NaN`', function test( t ) { - t.equal( isfinite( NaN ), false, 'returns false' ); - t.equal( isfinite( 0/0 ), false, 'returns false' ); + t.equal( isfinite( NaN ), false, 'returns expected value' ); + t.equal( isfinite( 0/0 ), false, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-finite/test/test.native.js b/lib/node_modules/@stdlib/math/base/assert/is-finite/test/test.native.js index 23d2fe6b7226..bceeb4422aee 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finite/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-finite/test/test.native.js @@ -57,20 +57,20 @@ tape( 'the function returns `true` if provided a finite number', opts, function ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isfinite( values[i] ), true, 'returns true when provided '+values[i] ); + t.equal( isfinite( values[i] ), true, 'returns expected value when provided '+values[i] ); } for ( i = -100; i < 101; i++ ) { - t.equal( isfinite( i ), true, 'returns true when provided '+i ); + t.equal( isfinite( i ), true, 'returns expected value when provided '+i ); } t.end(); }); tape( 'the function returns `false` if provided `+infinity`', opts, function test( t ) { - t.equal( isfinite( PINF ), false, 'returns false' ); + t.equal( isfinite( PINF ), false, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `-infinity`', opts, function test( t ) { - t.equal( isfinite( NINF ), false, 'returns false' ); + t.equal( isfinite( NINF ), false, 'returns expected value' ); t.end(); });