diff --git a/lib/node_modules/@stdlib/math/base/assert/is-integer/test/test.js b/lib/node_modules/@stdlib/math/base/assert/is-integer/test/test.js index 19a964886669..79c36f28f0b6 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-integer/test/test.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-integer/test/test.js @@ -39,7 +39,7 @@ tape( 'main export is a function', function test( t ) { tape( 'the function returns `true` if provided an integer', function test( t ) { var i; for ( i = -50; i < 51; i++ ) { - t.equal( isInteger( i ), true, 'returns true when provided '+i ); + t.equal( isInteger( i ), true, 'returns expected value when provided '+i ); } t.end(); }); @@ -50,23 +50,23 @@ tape( 'the function returns `false` if not provided an integer', function test( for ( i = 0; i < 100; i++ ) { v = ( randu()*100.0 ) - 50.0; if ( trunc(v) !== v ) { - t.equal( isInteger( v ), false, 'returns false when provided '+v ); + t.equal( isInteger( v ), false, 'returns expected value when provided '+v ); } } t.end(); }); tape( 'the function returns `false` if provided `NaN`', function test( t ) { - t.equal( isInteger( NaN ), false, 'returns false' ); + t.equal( isInteger( NaN ), false, 'returns expected value' ); t.end(); }); tape( 'WARNING: function returns `true` if provided `+infinity`', function test( t ) { - t.equal( isInteger( PINF ), true, 'returns true' ); + t.equal( isInteger( PINF ), true, 'returns expected value' ); t.end(); }); tape( 'WARNING: function returns `true` if provided `-infinity`', function test( t ) { - t.equal( isInteger( NINF ), true, 'returns true' ); + t.equal( isInteger( NINF ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-integer/test/test.native.js b/lib/node_modules/@stdlib/math/base/assert/is-integer/test/test.native.js index 71beb7f55908..9b97af19a2f0 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-integer/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-integer/test/test.native.js @@ -48,7 +48,7 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'the function returns `true` if provided an integer', opts, function test( t ) { var i; for ( i = -50; i < 51; i++ ) { - t.equal( isInteger( i ), true, 'returns true when provided '+i ); + t.equal( isInteger( i ), true, 'returns expected value when provided '+i ); } t.end(); }); @@ -59,23 +59,23 @@ tape( 'the function returns `false` if not provided an integer', opts, function for ( i = 0; i < 100; i++ ) { v = ( randu()*100.0 ) - 50.0; if ( trunc(v) !== v ) { - t.equal( isInteger( v ), false, 'returns false when provided '+v ); + t.equal( isInteger( v ), false, 'returns expected value when provided '+v ); } } t.end(); }); tape( 'the function returns `false` if provided `NaN`', opts, function test( t ) { - t.equal( isInteger( NaN ), false, 'returns false' ); + t.equal( isInteger( NaN ), false, 'returns expected value' ); t.end(); }); tape( 'WARNING: function returns `true` if provided `+infinity`', opts, function test( t ) { - t.equal( isInteger( PINF ), true, 'returns true' ); + t.equal( isInteger( PINF ), true, 'returns expected value' ); t.end(); }); tape( 'WARNING: function returns `true` if provided `-infinity`', opts, function test( t ) { - t.equal( isInteger( NINF ), true, 'returns true' ); + t.equal( isInteger( NINF ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-integerf/test/test.js b/lib/node_modules/@stdlib/math/base/assert/is-integerf/test/test.js index 3660f2e51aac..749ee3a3aeaa 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-integerf/test/test.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-integerf/test/test.js @@ -39,7 +39,7 @@ tape( 'main export is a function', function test( t ) { tape( 'the function returns `true` if provided an integer', function test( t ) { var i; for ( i = -50; i < 51; i++ ) { - t.equal( isIntegerf( i ), true, 'returns true when provided '+i ); + t.equal( isIntegerf( i ), true, 'returns expected value when provided '+i ); } t.end(); }); @@ -50,23 +50,23 @@ tape( 'the function returns `false` if not provided an integer', function test( for ( i = 0; i < 100; i++ ) { v = ( randu() * 100.0 ) - 50.0; if ( truncf( v ) !== v ) { - t.equal( isIntegerf( v ), false, 'returns false when provided '+v ); + t.equal( isIntegerf( v ), false, 'returns expected value when provided '+v ); } } t.end(); }); tape( 'the function returns `false` if provided `NaN`', function test( t ) { - t.equal( isIntegerf( NaN ), false, 'returns false' ); + t.equal( isIntegerf( NaN ), false, 'returns expected value' ); t.end(); }); tape( 'WARNING: function returns `true` if provided `+infinity`', function test( t ) { - t.equal( isIntegerf( PINF ), true, 'returns true' ); + t.equal( isIntegerf( PINF ), true, 'returns expected value' ); t.end(); }); tape( 'WARNING: function returns `true` if provided `-infinity`', function test( t ) { - t.equal( isIntegerf( NINF ), true, 'returns true' ); + t.equal( isIntegerf( NINF ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-integerf/test/test.native.js b/lib/node_modules/@stdlib/math/base/assert/is-integerf/test/test.native.js index 0ab84c498053..24af5f45ff8a 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-integerf/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-integerf/test/test.native.js @@ -48,7 +48,7 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'the function returns `true` if provided an integer', opts, function test( t ) { var i; for ( i = -50; i < 51; i++ ) { - t.equal( isIntegerf( i ), true, 'returns true when provided '+i ); + t.equal( isIntegerf( i ), true, 'returns expected value when provided '+i ); } t.end(); }); @@ -59,23 +59,23 @@ tape( 'the function returns `false` if not provided an integer', opts, function for ( i = 0; i < 100; i++ ) { v = ( randu() * 100.0 ) - 50.0; if ( truncf( v ) !== v ) { - t.equal( isIntegerf( v ), false, 'returns false when provided '+v ); + t.equal( isIntegerf( v ), false, 'returns expected value when provided '+v ); } } t.end(); }); tape( 'the function returns `false` if provided `NaN`', opts, function test( t ) { - t.equal( isIntegerf( NaN ), false, 'returns false' ); + t.equal( isIntegerf( NaN ), false, 'returns expected value' ); t.end(); }); tape( 'WARNING: function returns `true` if provided `+infinity`', opts, function test( t ) { - t.equal( isIntegerf( PINF ), true, 'returns true' ); + t.equal( isIntegerf( PINF ), true, 'returns expected value' ); t.end(); }); tape( 'WARNING: function returns `true` if provided `-infinity`', opts, function test( t ) { - t.equal( isIntegerf( NINF ), true, 'returns true' ); + t.equal( isIntegerf( NINF ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nan/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/assert/is-nan/benchmark/benchmark.js index 904b10f29f4c..c379cee48a8d 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nan/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-nan/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 isnan = require( './../lib' ); @@ -30,14 +30,19 @@ var isnan = 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 = isnan( x ); + y = isnan( 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-nan/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/assert/is-nan/benchmark/benchmark.native.js index 5e955da721b6..08526769f489 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nan/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-nan/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 = isnan( x ); + y = isnan( 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-nan/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-nan/benchmark/c/benchmark.c index 3b43703ec4c7..7a99c974b3b2 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nan/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-nan/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 = isnan( x ); + y = isnan( 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-nan/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-nan/benchmark/c/native/benchmark.c index a2b5801a8cae..7279276b0cca 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nan/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-nan/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_nan( x ); + b = stdlib_base_is_nan( 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-nan/test/test.js b/lib/node_modules/@stdlib/math/base/assert/is-nan/test/test.js index a5c68b7d223e..de3968bc2eac 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nan/test/test.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-nan/test/test.js @@ -34,7 +34,7 @@ tape( 'main export is a function', function test( t ) { }); tape( 'the function returns `true` if provided `NaN`', function test( t ) { - t.equal( isnan( NaN ), true, 'returns true' ); + t.equal( isnan( NaN ), true, 'returns expected value' ); t.end(); }); @@ -52,11 +52,11 @@ tape( 'the function returns `false` if not provided `NaN`', function test( t ) { [], {}, function noop() {}, - new Number( NaN ) // eslint-disable-line no-new-wrappers + new Number( NaN ) ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isnan( values[i] ), false, 'returns false when provided ' + values[ i ] ); + t.equal( isnan( values[i] ), false, 'returns expected value when provided ' + values[ i ] ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nan/test/test.native.js b/lib/node_modules/@stdlib/math/base/assert/is-nan/test/test.native.js index 8b739c73ca81..8f1a7d0fd1ea 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nan/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-nan/test/test.native.js @@ -43,7 +43,7 @@ tape( 'main export is a function', opts, function test( t ) { }); tape( 'the function returns `true` if provided `NaN`', opts, function test( t ) { - t.equal( isnan( NaN ), true, 'returns true' ); + t.equal( isnan( NaN ), true, 'returns expected value' ); t.end(); }); @@ -61,11 +61,11 @@ tape( 'the function returns `false` if not provided `NaN`', opts, function test( [], {}, function noop() {}, - new Number( NaN ) // eslint-disable-line no-new-wrappers + new Number( NaN ) ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isnan( values[i] ), false, 'returns false when provided ' + values[ i ] ); + t.equal( isnan( values[i] ), false, 'returns expected value when provided ' + values[ i ] ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nanf/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/assert/is-nanf/benchmark/benchmark.js index 192d0361b785..d55496fc8cdc 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nanf/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-nanf/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 isnanf = require( './../lib' ); @@ -30,14 +30,19 @@ var isnanf = 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 = isnanf( x ); + y = isnanf( 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-nanf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/assert/is-nanf/benchmark/benchmark.native.js index d8ab6cec76c9..361a1fb4fe45 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nanf/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-nanf/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 = isnanf( x ); + y = isnanf( 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-nanf/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-nanf/benchmark/c/benchmark.c index ef239773415e..5d371ac2d642 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nanf/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-nanf/benchmark/c/benchmark.c @@ -90,15 +90,18 @@ static float rand_float( void ) { */ static double benchmark( void ) { double elapsed; + float x[ 100 ]; double t; - float x; int 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 = isnan( x ); + y = isnan( 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-nanf/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-nanf/benchmark/c/native/benchmark.c index 0ca0e9281ad4..41ba2696ceb0 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nanf/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-nanf/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_nanf( x ); + b = stdlib_base_is_nanf( 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-nanf/test/test.js b/lib/node_modules/@stdlib/math/base/assert/is-nanf/test/test.js index df288ad9cd7f..556e8a597bee 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nanf/test/test.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-nanf/test/test.js @@ -34,7 +34,7 @@ tape( 'main export is a function', function test( t ) { }); tape( 'the function returns `true` if provided `NaN`', function test( t ) { - t.equal( isnanf( NaN ), true, 'returns true' ); + t.equal( isnanf( NaN ), true, 'returns expected value' ); t.end(); }); @@ -52,11 +52,11 @@ tape( 'the function returns `false` if not provided `NaN`', function test( t ) { [], {}, function noop() {}, - new Number( NaN ) // eslint-disable-line no-new-wrappers + new Number( NaN ) ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isnanf( values[i] ), false, 'returns false when provided ' + values[ i ] ); + t.equal( isnanf( values[i] ), false, 'returns expected value when provided ' + values[ i ] ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-nanf/test/test.native.js b/lib/node_modules/@stdlib/math/base/assert/is-nanf/test/test.native.js index 1bf16cadd144..d197806b0f46 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-nanf/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-nanf/test/test.native.js @@ -42,6 +42,6 @@ tape( 'main export is a function', opts, function test( t ) { }); tape( 'the function returns `true` if provided `NaN`', opts, function test( t ) { - t.equal( isnanf( NaN ), true, 'returns true' ); + t.equal( isnanf( NaN ), true, 'returns expected value' ); t.end(); });