From 96ce64682e56f0baff090de52aa1e6d94c7d87ca Mon Sep 17 00:00:00 2001 From: hrshya Date: Wed, 26 Mar 2025 20:56:45 +0530 Subject: [PATCH] bench: update random value generation --- .../base/special/rcbrtf/benchmark/benchmark.js | 9 ++++++--- .../rcbrtf/benchmark/benchmark.native.js | 9 ++++++--- .../rcbrtf/benchmark/c/native/benchmark.c | 9 ++++++--- .../math/base/special/rcbrtf/test/test.js | 8 ++++---- .../base/special/rcbrtf/test/test.native.js | 8 ++++---- .../special/rempio2/benchmark/benchmark.js | 4 ++-- .../rempio2/benchmark/benchmark.native.js | 4 ++-- .../riemann-zeta/benchmark/benchmark.js | 4 ++-- .../riemann-zeta/benchmark/benchmark.native.js | 4 ++-- .../rising-factorial/benchmark/benchmark.js | 11 ++++++----- .../base/special/rising-factorial/test/test.js | 18 +++++++++--------- .../base/special/round/benchmark/benchmark.js | 6 +++--- .../round/benchmark/benchmark.native.js | 4 ++-- .../base/special/round2/benchmark/benchmark.js | 7 ++++--- .../round2/benchmark/benchmark.native.js | 7 ++++--- .../round2/benchmark/c/native/benchmark.c | 9 ++++++--- .../math/base/special/round2/test/test.js | 16 ++++++++-------- .../base/special/round2/test/test.native.js | 14 +++++++------- 18 files changed, 83 insertions(+), 68 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/rcbrtf/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/rcbrtf/benchmark/benchmark.js index dac86dc6d959..39028c784c42 100644 --- a/lib/node_modules/@stdlib/math/base/special/rcbrtf/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/rcbrtf/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 isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pkg = require( './../package.json' ).name; var rcbrtf = require( './../lib' ); @@ -34,10 +34,13 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, 0.0, 100000.0, { + 'dtype': 'float32' + }); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 100000.0 ) - 0.0; - y = rcbrtf( x ); + y = rcbrtf( x[ i%x.length ] ); if ( isnanf( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/rcbrtf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/rcbrtf/benchmark/benchmark.native.js index 0431849bc078..88fbfcbdeb1e 100644 --- a/lib/node_modules/@stdlib/math/base/special/rcbrtf/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/rcbrtf/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 isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -43,10 +43,13 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + x = uniform( 100, 0.0, 100000.0, { + 'dtype': 'float32' + }); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 100000.0 ) - 0.0; - y = rcbrtf( x ); + y = rcbrtf( x[ i%x.length ] ); if ( isnanf( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/rcbrtf/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/rcbrtf/benchmark/c/native/benchmark.c index 7b4420588df2..f2533b5ac5a2 100644 --- a/lib/node_modules/@stdlib/math/base/special/rcbrtf/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/rcbrtf/benchmark/c/native/benchmark.c @@ -92,14 +92,17 @@ static float rand_float( void ) { static double benchmark( void ) { double elapsed; double t; - float x; + float x[ 100 ]; float y; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = rand_float() * 100000.0f; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = rand_float() * 100000.0f; - y = stdlib_base_rcbrtf( x ); + y = stdlib_base_rcbrtf( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/rcbrtf/test/test.js b/lib/node_modules/@stdlib/math/base/special/rcbrtf/test/test.js index 130cb26ac7f5..fbf1c949ccd9 100644 --- a/lib/node_modules/@stdlib/math/base/special/rcbrtf/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/rcbrtf/test/test.js @@ -439,24 +439,24 @@ tape( 'the function returns `NaN` if provided `NaN`', function test( t ) { tape( 'the function returns `0.0` if provided `+infinity`', function test( t ) { var v = rcbrtf( PINF ); - t.equal( v, 0.0, 'returns 0.0' ); + t.equal( v, 0.0, 'returns expected value' ); t.end(); }); tape( 'the function returns `+infinity` if provided `+0`', function test( t ) { var v = rcbrtf( +0.0 ); - t.equal( v, PINF, 'returns +infinity' ); + t.equal( v, PINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `-infinity` if provided `-0`', function test( t ) { var v = rcbrtf( -0.0 ); - t.equal( v, NINF, 'returns -infinity' ); + t.equal( v, NINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `0.0` if provided `-infinity`', function test( t ) { var v = rcbrtf( NINF ); - t.equal( v, 0.0, 'returns 0.0' ); + t.equal( v, 0.0, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/rcbrtf/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/rcbrtf/test/test.native.js index 7d82722559a3..62d044801ce5 100644 --- a/lib/node_modules/@stdlib/math/base/special/rcbrtf/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/rcbrtf/test/test.native.js @@ -448,24 +448,24 @@ tape( 'the function returns `NaN` if provided `NaN`', opts, function test( t ) { tape( 'the function returns `0.0` if provided `+infinity`', opts, function test( t ) { var v = rcbrtf( PINF ); - t.equal( v, 0.0, 'returns 0.0' ); + t.equal( v, 0.0, 'returns expected value' ); t.end(); }); tape( 'the function returns `+infinity` if provided `+0`', opts, function test( t ) { var v = rcbrtf( +0.0 ); - t.equal( v, PINF, 'returns +infinity' ); + t.equal( v, PINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `-infinity` if provided `-0`', opts, function test( t ) { var v = rcbrtf( -0.0 ); - t.equal( v, NINF, 'returns -infinity' ); + t.equal( v, NINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `0.0` if provided `-infinity`', opts, function test( t ) { var v = rcbrtf( NINF ); - t.equal( v, 0.0, 'returns 0.0' ); + t.equal( v, 0.0, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.js index c654c7d2a26c..a428bd8d5024 100644 --- a/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/array/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var rempio2 = require( './../lib' ); @@ -36,7 +36,7 @@ bench( pkg, function benchmark( b ) { var i; y = [ 0.0, 0.0 ]; - x = randu( 100, -100.0, 100.0 ); + x = uniform( 100, -100.0, 100.0 ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.native.js index d231943ea28c..d617ab5dd909 100644 --- a/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/array/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -45,7 +45,7 @@ bench( pkg+'::native', opts, function benchmark( b ) { var i; y = [ 0.0, 0.0 ]; - x = randu( 100, -100.0, 100.0 ); + x = uniform( 100, -100.0, 100.0 ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/math/base/special/riemann-zeta/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/riemann-zeta/benchmark/benchmark.js index 9f0e64e05e2c..83a353acc9f3 100644 --- a/lib/node_modules/@stdlib/math/base/special/riemann-zeta/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/riemann-zeta/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/array/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -35,7 +35,7 @@ bench( pkg, function benchmark( b ) { var y; var i; - x = randu( 100, 1.0 + EPS, 57.0 + EPS ); + x = uniform( 100, 1.0 + EPS, 57.0 + EPS ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/math/base/special/riemann-zeta/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/riemann-zeta/benchmark/benchmark.native.js index 9e860b4828cd..fae745fcb63e 100644 --- a/lib/node_modules/@stdlib/math/base/special/riemann-zeta/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/riemann-zeta/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/array/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -44,7 +44,7 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; - x = randu( 100, 1.0 + EPS, 57.0 + EPS ); + x = uniform( 100, 1.0 + EPS, 57.0 + EPS ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/math/base/special/rising-factorial/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/rising-factorial/benchmark/benchmark.js index 099e2d38b2cb..fe4d2be68777 100644 --- a/lib/node_modules/@stdlib/math/base/special/rising-factorial/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/rising-factorial/benchmark/benchmark.js @@ -21,8 +21,8 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var risingFactorial = require( './../lib' ); @@ -36,11 +36,12 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -50.0, 50.0 ); + n = discreteUniform( 100, -50, 50 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*100.0 ) - 50.0; - n = round( ( randu()*100.0 ) - 50.0 ); - y = risingFactorial( x, n ); + y = risingFactorial( x[ i%x.length ], n[ i%n.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/rising-factorial/test/test.js b/lib/node_modules/@stdlib/math/base/special/rising-factorial/test/test.js index 52489fbecf80..d295ff4ae83d 100644 --- a/lib/node_modules/@stdlib/math/base/special/rising-factorial/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/rising-factorial/test/test.js @@ -42,41 +42,41 @@ tape( 'main export is a function', function test( t ) { tape( 'the function returns `NaN` if provided `NaN` as any argument', function test( t ) { var val = risingFactorial( 0.5, NaN ); - t.equal( isnan( val ), true, 'returns NaN' ); + t.equal( isnan( val ), true, 'returns expected value' ); val = risingFactorial( NaN, -1.0 ); - t.equal( isnan( val ), true, 'returns NaN' ); + t.equal( isnan( val ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `1` if provided `n = 0` and a nonnegative `x`', function test( t ) { var val = risingFactorial( 2.0, 0 ); - t.equal( val, 1.0, 'returns 1' ); + t.equal( val, 1.0, 'returns expected value' ); val = risingFactorial( 0.2, 0 ); - t.equal( val, 1.0, 'returns 1' ); + t.equal( val, 1.0, 'returns expected value' ); val = risingFactorial( -2.0, 0 ); - t.equal( val, 1.0, 'returns 1' ); + t.equal( val, 1.0, 'returns expected value' ); val = risingFactorial( -0.2, 0 ); - t.equal( val, 1.0, 'returns 1' ); + t.equal( val, 1.0, 'returns expected value' ); t.end(); }); tape( 'the function returns `0` if provided `x = 0` and a positive `n`', function test( t ) { var val = risingFactorial( 0.0, 4 ); - t.equal( val, 0.0, 'returns 0' ); + t.equal( val, 0.0, 'returns expected value' ); val = risingFactorial( 0.0, 1 ); - t.equal( val, 0.0, 'returns 0' ); + t.equal( val, 0.0, 'returns expected value' ); t.end(); }); tape( 'the function returns evaluates the rising factorial if provided `x = 0` and a negative `n`', function test( t ) { var val = risingFactorial( 0.0, -1 ); - t.equal( val, -1.0, 'returns -1' ); + t.equal( val, -1.0, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/round/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/round/benchmark/benchmark.js index 760fe2476bc2..eca3fa871971 100644 --- a/lib/node_modules/@stdlib/math/base/special/round/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/round/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/array/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var round = require( './../lib' ); @@ -34,7 +34,7 @@ bench( pkg, function benchmark( b ) { var y; var i; - x = randu( 100, -500.0, 500.0 ); + x = uniform( 100, -500.0, 500.0 ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { @@ -56,7 +56,7 @@ bench( pkg+'::built-in', function benchmark( b ) { var y; var i; - x = randu( 100, -500.0, 500.0 ); + x = uniform( 100, -500.0, 500.0 ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/math/base/special/round/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/round/benchmark/benchmark.native.js index 591560fc83e7..bd84b8968485 100644 --- a/lib/node_modules/@stdlib/math/base/special/round/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/round/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/array/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -43,7 +43,7 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; - x = randu( 100, -500.0, 500.0 ); + x = uniform( 100, -500.0, 500.0 ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/math/base/special/round2/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/round2/benchmark/benchmark.js index 3b0b4749d8e3..8531bb0f754e 100644 --- a/lib/node_modules/@stdlib/math/base/special/round2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/round2/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var round2 = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0e6, 5.0e6 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = round2( x ); + y = round2( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/round2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/round2/benchmark/benchmark.native.js index deb24dfdd018..2070e7e7a49c 100644 --- a/lib/node_modules/@stdlib/math/base/special/round2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/round2/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -43,10 +43,11 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0e6, 5.0e6 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 1.0e7 ) - 5.0e6; - y = round2( x ); + y = round2( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/round2/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/round2/benchmark/c/native/benchmark.c index 89d8989a1599..28fd687ba1f2 100644 --- a/lib/node_modules/@stdlib/math/base/special/round2/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/round2/benchmark/c/native/benchmark.c @@ -91,15 +91,18 @@ static double rand_double( void ) { */ static double benchmark( void ) { double elapsed; - double x; + double x[ 100 ]; double y; double t; 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 = stdlib_base_round2( x ); + y = stdlib_base_round2( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/round2/test/test.js b/lib/node_modules/@stdlib/math/base/special/round2/test/test.js index a1e5da0ee8b8..8d9f587506be 100644 --- a/lib/node_modules/@stdlib/math/base/special/round2/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/round2/test/test.js @@ -44,35 +44,35 @@ tape( 'the function returns `+0` if provided `+0`', function test( t ) { var v; v = round2( 0.0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); v = round2( +0.0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `-0` if provided `-0`', function test( t ) { var v = round2( -0.0 ); - t.strictEqual( isNegativeZero( v ), true, 'returns -0' ); + t.strictEqual( isNegativeZero( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) { var v = round2( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `+infinity` if provided `+infinity`', function test( t ) { var v = round2( PINF ); - t.strictEqual( v, PINF, 'returns +infinity' ); + t.strictEqual( v, PINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `-infinity` if provided `-infinity`', function test( t ) { var v = round2( NINF ); - t.strictEqual( v, NINF, 'returns -infinity' ); + t.strictEqual( v, NINF, 'returns expected value' ); t.end(); }); @@ -88,11 +88,11 @@ tape( 'the function overflows if provided a sufficiently large value', function x = exp2( 1023 ); v = round2( x + (x/2.0) ); - t.strictEqual( v, PINF, 'returns +infinity' ); + t.strictEqual( v, PINF, 'returns expected value' ); x = -exp2( 1023 ); v = round2( x + (x/2.0) ); - t.strictEqual( v, NINF, 'returns -infinity' ); + t.strictEqual( v, NINF, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/round2/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/round2/test/test.native.js index 8ea63ca3bbfd..804e0b6225c5 100644 --- a/lib/node_modules/@stdlib/math/base/special/round2/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/round2/test/test.native.js @@ -53,17 +53,17 @@ tape( 'the function returns `+0` if provided `+0`', opts, function test( t ) { var v; v = round2( 0.0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); v = round2( +0.0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `-0` if provided `-0`', opts, function test( t ) { var v = round2( -0.0 ); - t.strictEqual( isNegativeZero( v ), true, 'returns -0' ); + t.strictEqual( isNegativeZero( v ), true, 'returns expected value' ); t.end(); }); @@ -75,13 +75,13 @@ tape( 'the function returns `NaN` if provided a `NaN`', opts, function test( t ) tape( 'the function returns `+infinity` if provided `+infinity`', opts, function test( t ) { var v = round2( PINF ); - t.strictEqual( v, PINF, 'returns +infinity' ); + t.strictEqual( v, PINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `-infinity` if provided `-infinity`', opts, function test( t ) { var v = round2( NINF ); - t.strictEqual( v, NINF, 'returns -infinity' ); + t.strictEqual( v, NINF, 'returns expected value' ); t.end(); }); @@ -97,11 +97,11 @@ tape( 'the function overflows if provided a sufficiently large value', opts, fun x = exp2( 1023 ); v = round2( x + (x/2.0) ); - t.strictEqual( v, PINF, 'returns +infinity' ); + t.strictEqual( v, PINF, 'returns expected value' ); x = -exp2( 1023 ); v = round2( x + (x/2.0) ); - t.strictEqual( v, NINF, 'returns -infinity' ); + t.strictEqual( v, NINF, 'returns expected value' ); t.end(); });