diff --git a/lib/node_modules/@stdlib/stats/strided/dsem/test/test.dsem.js b/lib/node_modules/@stdlib/stats/strided/dsem/test/test.dsem.js index 01030547667a..a802acf9852a 100644 --- a/lib/node_modules/@stdlib/stats/strided/dsem/test/test.dsem.js +++ b/lib/node_modules/@stdlib/stats/strided/dsem/test/test.dsem.js @@ -22,10 +22,9 @@ var tape = require( 'tape' ); var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var Float64Array = require( '@stdlib/array/float64' ); -var EPS = require( '@stdlib/constants/float64/eps' ); var dsem = require( './../lib/dsem.js' ); @@ -44,8 +43,6 @@ tape( 'the function has an arity of 4', function test( t ) { tape( 'the function calculates the standard error of the mean for a strided array (population)', function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -53,9 +50,7 @@ tape( 'the function calculates the standard error of the mean for a strided arra v = dsem( x.length, 0, x, 1 ); expected = sqrt( 53.5/x.length ) / sqrt( x.length ); - delta = abs( v - expected ); - tol = 1.0 * EPS * abs( expected ); - t.strictEqual( delta <= tol, true, 'within tolerance. Actual: '+v+'. E: '+expected+'. tol: '+tol+'. Δ: '+delta+'.' ); + t.strictEqual( isAlmostSameValue( v, expected, 1 ), true, 'returns expected value' ); x = new Float64Array( [ -4.0, -4.0 ] ); v = dsem( x.length, 0, x, 1 ); @@ -70,8 +65,6 @@ tape( 'the function calculates the standard error of the mean for a strided arra tape( 'the function calculates the standard error of the mean for a strided array (sample)', function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -79,9 +72,7 @@ tape( 'the function calculates the standard error of the mean for a strided arra v = dsem( x.length, 1, x, 1 ); expected = sqrt( 53.5/(x.length-1) ) / sqrt( x.length ); - delta = abs( v - expected ); - tol = 1.0 * EPS * abs( expected ); - t.strictEqual( delta <= tol, true, 'within tolerance. Actual: '+v+'. E: '+expected+'. tol: '+tol+'. Δ: '+delta+'.' ); + t.strictEqual( isAlmostSameValue( v, expected, 1 ), true, 'returns expected value' ); x = new Float64Array( [ -4.0, -4.0 ] ); v = dsem( x.length, 1, x, 1 ); diff --git a/lib/node_modules/@stdlib/stats/strided/dsem/test/test.dsem.native.js b/lib/node_modules/@stdlib/stats/strided/dsem/test/test.dsem.native.js index 6603f2b46f6a..3523bd65e728 100644 --- a/lib/node_modules/@stdlib/stats/strided/dsem/test/test.dsem.native.js +++ b/lib/node_modules/@stdlib/stats/strided/dsem/test/test.dsem.native.js @@ -23,10 +23,9 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var Float64Array = require( '@stdlib/array/float64' ); -var EPS = require( '@stdlib/constants/float64/eps' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -53,8 +52,6 @@ tape( 'the function has an arity of 4', opts, function test( t ) { tape( 'the function calculates the standard error of the mean for a strided array (population)', opts, function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -62,9 +59,7 @@ tape( 'the function calculates the standard error of the mean for a strided arra v = dsem( x.length, 0, x, 1 ); expected = sqrt( 53.5/x.length ) / sqrt( x.length ); - delta = abs( v - expected ); - tol = 1.0 * EPS * abs( expected ); - t.strictEqual( delta <= tol, true, 'within tolerance. Actual: '+v+'. E: '+expected+'. tol: '+tol+'. Δ: '+delta+'.' ); + t.strictEqual( isAlmostSameValue( v, expected, 1 ), true, 'returns expected value' ); x = new Float64Array( [ -4.0, -4.0 ] ); v = dsem( x.length, 0, x, 1 ); @@ -79,8 +74,6 @@ tape( 'the function calculates the standard error of the mean for a strided arra tape( 'the function calculates the standard error of the mean for a strided array (sample)', opts, function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -88,9 +81,7 @@ tape( 'the function calculates the standard error of the mean for a strided arra v = dsem( x.length, 1, x, 1 ); expected = sqrt( 53.5/(x.length-1) ) / sqrt( x.length ); - delta = abs( v - expected ); - tol = 1.0 * EPS * abs( expected ); - t.strictEqual( delta <= tol, true, 'within tolerance. Actual: '+v+'. E: '+expected+'. tol: '+tol+'. Δ: '+delta+'.' ); + t.strictEqual( isAlmostSameValue( v, expected, 1 ), true, 'returns expected value' ); x = new Float64Array( [ -4.0, -4.0 ] ); v = dsem( x.length, 1, x, 1 ); diff --git a/lib/node_modules/@stdlib/stats/strided/dsem/test/test.ndarray.js b/lib/node_modules/@stdlib/stats/strided/dsem/test/test.ndarray.js index 19a1f3116c6f..182683450d57 100644 --- a/lib/node_modules/@stdlib/stats/strided/dsem/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/stats/strided/dsem/test/test.ndarray.js @@ -22,10 +22,9 @@ var tape = require( 'tape' ); var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var Float64Array = require( '@stdlib/array/float64' ); -var EPS = require( '@stdlib/constants/float64/eps' ); var dsem = require( './../lib/ndarray.js' ); @@ -44,8 +43,6 @@ tape( 'the function has an arity of 5', function test( t ) { tape( 'the function calculates the standard error of the mean for a strided array (population)', function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -53,9 +50,7 @@ tape( 'the function calculates the standard error of the mean for a strided arra v = dsem( x.length, 0, x, 1, 0 ); expected = sqrt( 53.5/x.length ) / sqrt( x.length ); - delta = abs( v - expected ); - tol = 1.0 * EPS * abs( expected ); - t.strictEqual( delta <= tol, true, 'within tolerance. Actual: '+v+'. E: '+expected+'. tol: '+tol+'. Δ: '+delta+'.' ); + t.strictEqual( isAlmostSameValue( v, expected, 1 ), true, 'returns expected value' ); x = new Float64Array( [ -4.0, -4.0 ] ); v = dsem( x.length, 0, x, 1, 0 ); @@ -70,8 +65,6 @@ tape( 'the function calculates the standard error of the mean for a strided arra tape( 'the function calculates the standard error of the mean for a strided array (sample)', function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -79,9 +72,7 @@ tape( 'the function calculates the standard error of the mean for a strided arra v = dsem( x.length, 1, x, 1, 0 ); expected = sqrt( 53.5/(x.length-1) ) / sqrt( x.length ); - delta = abs( v - expected ); - tol = 1.0 * EPS * abs( expected ); - t.strictEqual( delta <= tol, true, 'within tolerance. Actual: '+v+'. E: '+expected+'. tol: '+tol+'. Δ: '+delta+'.' ); + t.strictEqual( isAlmostSameValue( v, expected, 1 ), true, 'returns expected value' ); x = new Float64Array( [ -4.0, -4.0 ] ); v = dsem( x.length, 1, x, 1, 0 ); diff --git a/lib/node_modules/@stdlib/stats/strided/dsem/test/test.ndarray.native.js b/lib/node_modules/@stdlib/stats/strided/dsem/test/test.ndarray.native.js index 8ef80400841c..16d50bf62a97 100644 --- a/lib/node_modules/@stdlib/stats/strided/dsem/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/stats/strided/dsem/test/test.ndarray.native.js @@ -23,10 +23,9 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var Float64Array = require( '@stdlib/array/float64' ); -var EPS = require( '@stdlib/constants/float64/eps' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -53,8 +52,6 @@ tape( 'the function has an arity of 5', opts, function test( t ) { tape( 'the function calculates the standard error of the mean for a strided array (population)', opts, function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -62,9 +59,7 @@ tape( 'the function calculates the standard error of the mean for a strided arra v = dsem( x.length, 0, x, 1, 0 ); expected = sqrt( 53.5/x.length ) / sqrt( x.length ); - delta = abs( v - expected ); - tol = 1.0 * EPS * abs( expected ); - t.strictEqual( delta <= tol, true, 'within tolerance. Actual: '+v+'. E: '+expected+'. tol: '+tol+'. Δ: '+delta+'.' ); + t.strictEqual( isAlmostSameValue( v, expected, 1 ), true, 'returns expected value' ); x = new Float64Array( [ -4.0, -4.0 ] ); v = dsem( x.length, 0, x, 1, 0 ); @@ -79,8 +74,6 @@ tape( 'the function calculates the standard error of the mean for a strided arra tape( 'the function calculates the standard error of the mean for a strided array (sample)', opts, function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -88,9 +81,7 @@ tape( 'the function calculates the standard error of the mean for a strided arra v = dsem( x.length, 1, x, 1, 0 ); expected = sqrt( 53.5/(x.length-1) ) / sqrt( x.length ); - delta = abs( v - expected ); - tol = 1.0 * EPS * abs( expected ); - t.strictEqual( delta <= tol, true, 'within tolerance. Actual: '+v+'. E: '+expected+'. tol: '+tol+'. Δ: '+delta+'.' ); + t.strictEqual( isAlmostSameValue( v, expected, 1 ), true, 'returns expected value' ); x = new Float64Array( [ -4.0, -4.0 ] ); v = dsem( x.length, 1, x, 1, 0 );