diff --git a/lib/node_modules/@stdlib/math/base/special/fmodf/test/test.js b/lib/node_modules/@stdlib/math/base/special/fmodf/test/test.js index 4a77a6e48cab..3adca15f82f4 100644 --- a/lib/node_modules/@stdlib/math/base/special/fmodf/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/fmodf/test/test.js @@ -23,8 +23,6 @@ var tape = require( 'tape' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var absf = require( '@stdlib/math/base/special/absf' ); -var EPS = require( '@stdlib/constants/float32/eps' ); var fmodf = require( './../lib' ); @@ -49,8 +47,6 @@ tape( 'main export is a function', function test( t ) { tape( 'the function evaluates the modulus function (subnormal results)', function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -63,17 +59,13 @@ tape( 'the function evaluates the modulus function (subnormal results)', functio for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the modulus function (small `x`, large `y`)', function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -86,17 +78,13 @@ tape( 'the function evaluates the modulus function (small `x`, large `y`)', func for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the modulus function (large `x`, small `y`)', function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -109,17 +97,13 @@ tape( 'the function evaluates the modulus function (large `x`, small `y`)', func for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the modulus function (small `x`, small `y`)', function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -132,17 +116,13 @@ tape( 'the function evaluates the modulus function (small `x`, small `y`)', func for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the modulus function (positive `x`, negative `y`)', function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -155,17 +135,13 @@ tape( 'the function evaluates the modulus function (positive `x`, negative `y`)' for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the modulus function (negative `x`, positive `y`)', function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -178,17 +154,13 @@ tape( 'the function evaluates the modulus function (negative `x`, positive `y`)' for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the modulus function (negative `x`, negative `y`)', function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -201,9 +173,7 @@ tape( 'the function evaluates the modulus function (negative `x`, negative `y`)' for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/fmodf/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/fmodf/test/test.native.js index dd8b7089e995..16d730eb2ba3 100644 --- a/lib/node_modules/@stdlib/math/base/special/fmodf/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/fmodf/test/test.native.js @@ -24,8 +24,6 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var absf = require( '@stdlib/math/base/special/absf' ); -var EPS = require( '@stdlib/constants/float32/eps' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -58,8 +56,6 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'the function evaluates the modulus function (subnormal results)', opts, function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -72,17 +68,13 @@ tape( 'the function evaluates the modulus function (subnormal results)', opts, f for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the modulus function (small `x`, large `y`)', opts, function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -95,17 +87,13 @@ tape( 'the function evaluates the modulus function (small `x`, large `y`)', opts for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the modulus function (large `x`, small `y`)', opts, function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -118,17 +106,13 @@ tape( 'the function evaluates the modulus function (large `x`, small `y`)', opts for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the modulus function (small `x`, small `y`)', opts, function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -141,17 +125,13 @@ tape( 'the function evaluates the modulus function (small `x`, small `y`)', opts for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the modulus function (positive `x`, negative `y`)', opts, function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -164,17 +144,13 @@ tape( 'the function evaluates the modulus function (positive `x`, negative `y`)' for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the modulus function (negative `x`, positive `y`)', opts, function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -187,17 +163,13 @@ tape( 'the function evaluates the modulus function (negative `x`, positive `y`)' for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the modulus function (negative `x`, negative `y`)', opts, function test( t ) { var expected; - var delta; - var tol; var v; var x; var y; @@ -210,9 +182,7 @@ tape( 'the function evaluates the modulus function (negative `x`, negative `y`)' for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); v = fmodf( float64ToFloat32( x[ i ] ), float64ToFloat32( y[ i ] ) ); - delta = absf( v - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y[ i ]+'. v: '+v+'. E: '+e+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( v, e, 'returns expected value' ); } t.end(); });