diff --git a/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.ndarray.js b/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.ndarray.js index f9f3736702da..dc1d4e1ff160 100644 --- a/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.ndarray.js @@ -22,11 +22,10 @@ var tape = require( 'tape' ); var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var abs = require( '@stdlib/math/base/special/abs' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var EPS = require( '@stdlib/constants/float32/eps' ); var Float32Array = require( '@stdlib/array/float32' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var sstdevyc = require( './../lib/ndarray.js' ); @@ -45,8 +44,6 @@ tape( 'the function has an arity of 5', function test( t ) { tape( 'the function calculates the population standard deviation of a strided array', function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -54,9 +51,7 @@ tape( 'the function calculates the population standard deviation of a strided ar v = sstdevyc( x.length, 0, x, 1, 0 ); expected = float64ToFloat32( sqrt( 53.5/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( isAlmostSameValuef( v, expected, 1 ), true, 'returns expected value' ); x = new Float32Array( [ -4.0, -4.0 ] ); v = sstdevyc( x.length, 0, x, 1, 0 ); @@ -71,8 +66,6 @@ tape( 'the function calculates the population standard deviation of a strided ar tape( 'the function calculates the sample standard deviation of a strided array', function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -80,9 +73,7 @@ tape( 'the function calculates the sample standard deviation of a strided array' v = sstdevyc( x.length, 1, x, 1, 0 ); expected = float64ToFloat32( sqrt( 53.5/(x.length-1) ) ); - 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( isAlmostSameValuef( v, expected, 0 ), true, 'returns expected value' ); x = new Float32Array( [ -4.0, -4.0 ] ); v = sstdevyc( x.length, 1, x, 1, 0 ); diff --git a/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.ndarray.native.js b/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.ndarray.native.js index d60b3610c822..679ce62909a9 100644 --- a/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.ndarray.native.js @@ -23,11 +23,10 @@ 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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var EPS = require( '@stdlib/constants/float32/eps' ); var Float32Array = require( '@stdlib/array/float32' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -54,8 +53,6 @@ tape( 'the function has an arity of 5', opts, function test( t ) { tape( 'the function calculates the population standard deviation of a strided array', opts, function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -63,9 +60,7 @@ tape( 'the function calculates the population standard deviation of a strided ar v = sstdevyc( x.length, 0, x, 1, 0 ); expected = float64ToFloat32( sqrt( 53.5/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( isAlmostSameValuef( v, expected, 1 ), true, 'returns expected value' ); x = new Float32Array( [ -4.0, -4.0 ] ); v = sstdevyc( x.length, 0, x, 1, 0 ); @@ -80,8 +75,6 @@ tape( 'the function calculates the population standard deviation of a strided ar tape( 'the function calculates the sample standard deviation of a strided array', opts, function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -89,9 +82,7 @@ tape( 'the function calculates the sample standard deviation of a strided array' v = sstdevyc( x.length, 1, x, 1, 0 ); expected = float64ToFloat32( sqrt( 53.5/(x.length-1) ) ); - 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( isAlmostSameValuef( v, expected, 0 ), true, 'returns expected value' ); x = new Float32Array( [ -4.0, -4.0 ] ); v = sstdevyc( x.length, 1, x, 1, 0 ); diff --git a/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.sstdevyc.js b/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.sstdevyc.js index 950cafd36095..7898ff5ddcd7 100644 --- a/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.sstdevyc.js +++ b/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.sstdevyc.js @@ -22,11 +22,10 @@ var tape = require( 'tape' ); var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var abs = require( '@stdlib/math/base/special/abs' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var EPS = require( '@stdlib/constants/float32/eps' ); var Float32Array = require( '@stdlib/array/float32' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var sstdevyc = require( './../lib/sstdevyc.js' ); @@ -45,8 +44,6 @@ tape( 'the function has an arity of 4', function test( t ) { tape( 'the function calculates the population standard deviation of a strided array', function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -54,9 +51,7 @@ tape( 'the function calculates the population standard deviation of a strided ar v = sstdevyc( x.length, 0, x, 1 ); expected = float64ToFloat32( sqrt( 53.5/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( isAlmostSameValuef( v, expected, 1 ), true, 'returns expected value' ); x = new Float32Array( [ -4.0, -4.0 ] ); v = sstdevyc( x.length, 0, x, 1 ); @@ -71,8 +66,6 @@ tape( 'the function calculates the population standard deviation of a strided ar tape( 'the function calculates the sample standard deviation of a strided array', function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -80,9 +73,7 @@ tape( 'the function calculates the sample standard deviation of a strided array' v = sstdevyc( x.length, 1, x, 1 ); expected = float64ToFloat32( sqrt( 53.5/(x.length-1) ) ); - 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( isAlmostSameValuef( v, expected, 0 ), true, 'returns expected value' ); x = new Float32Array( [ -4.0, -4.0 ] ); v = sstdevyc( x.length, 1, x, 1 ); diff --git a/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.sstdevyc.native.js b/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.sstdevyc.native.js index e0c643bbe87a..47eaf92e4761 100644 --- a/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.sstdevyc.native.js +++ b/lib/node_modules/@stdlib/stats/strided/sstdevyc/test/test.sstdevyc.native.js @@ -23,11 +23,10 @@ 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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var EPS = require( '@stdlib/constants/float32/eps' ); var Float32Array = require( '@stdlib/array/float32' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -54,8 +53,6 @@ tape( 'the function has an arity of 4', opts, function test( t ) { tape( 'the function calculates the population standard deviation of a strided array', opts, function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -63,9 +60,7 @@ tape( 'the function calculates the population standard deviation of a strided ar v = sstdevyc( x.length, 0, x, 1 ); expected = float64ToFloat32( sqrt( 53.5/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( isAlmostSameValuef( v, expected, 1 ), true, 'returns expected value' ); x = new Float32Array( [ -4.0, -4.0 ] ); v = sstdevyc( x.length, 0, x, 1 ); @@ -80,8 +75,6 @@ tape( 'the function calculates the population standard deviation of a strided ar tape( 'the function calculates the sample standard deviation of a strided array', opts, function test( t ) { var expected; - var delta; - var tol; var x; var v; @@ -89,9 +82,7 @@ tape( 'the function calculates the sample standard deviation of a strided array' v = sstdevyc( x.length, 1, x, 1 ); expected = float64ToFloat32( sqrt( 53.5/(x.length-1) ) ); - 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( isAlmostSameValuef( v, expected, 0 ), true, 'returns expected value' ); x = new Float32Array( [ -4.0, -4.0 ] ); v = sstdevyc( x.length, 1, x, 1 );