Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions lib/node_modules/@stdlib/math/base/special/hypot/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
var tape = require( 'tape' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var EPS = require( '@stdlib/constants/float64/eps' );
var abs = require( '@stdlib/math/base/special/abs' );
var sqrt = require( '@stdlib/math/base/special/sqrt' );
var pow = require( '@stdlib/math/base/special/pow' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var hypot = require( './../lib' );


Expand Down Expand Up @@ -122,8 +121,6 @@ tape( 'the function returns `+0` if both arguments are `+-0`', function test( t

tape( 'the function computes the hypotenuse', function test( t ) {
var expected;
var delta;
var tol;
var h;
var x;
var y;
Expand All @@ -135,13 +132,7 @@ tape( 'the function computes the hypotenuse', function test( t ) {

for ( i = 0; i < x.length; i++ ) {
h = hypot( x[ i ], y[ i ] );
if ( h === expected[ i ] ) {
t.ok( true, 'x: '+x[i]+'. y: '+y[i]+'. h: '+h+'. Expected: '+expected[i]+'.' );
} else {
delta = abs( h - expected[ i ] );
tol = 1.4 * EPS * abs( expected[ i ] );
t.strictEqual( delta <= tol, true, 'within tolerance. x: '+x[i]+'. y: '+y[i]+'. h: '+h+'. Expected: '+expected[i]+'. Delta: '+delta+'. Tol: '+tol+'.' );
}
t.strictEqual( isAlmostSameValue( h, expected[ i ], 2 ), true, 'returns expected value' );
}
t.end();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ var resolve = require( 'path' ).resolve;
var tape = require( 'tape' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var EPS = require( '@stdlib/constants/float64/eps' );
var abs = require( '@stdlib/math/base/special/abs' );
var sqrt = require( '@stdlib/math/base/special/sqrt' );
var pow = require( '@stdlib/math/base/special/pow' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var tryRequire = require( '@stdlib/utils/try-require' );


Expand Down Expand Up @@ -131,8 +130,6 @@ tape( 'the function returns `+0` if both arguments are `+-0`', opts, function te

tape( 'the function computes the hypotenuse', opts, function test( t ) {
var expected;
var delta;
var tol;
var h;
var x;
var y;
Expand All @@ -144,13 +141,7 @@ tape( 'the function computes the hypotenuse', opts, function test( t ) {

for ( i = 0; i < x.length; i++ ) {
h = hypot( x[ i ], y[ i ] );
if ( h === expected[ i ] ) {
t.ok( true, 'x: '+x[i]+'. y: '+y[i]+'. h: '+h+'. Expected: '+expected[i]+'.' );
} else {
delta = abs( h - expected[ i ] );
tol = 1.4 * EPS * abs( expected[ i ] );
t.strictEqual( delta <= tol, true, 'within tolerance. x: '+x[i]+'. y: '+y[i]+'. h: '+h+'. Expected: '+expected[i]+'. Delta: '+delta+'. Tol: '+tol+'.' );
}
t.strictEqual( isAlmostSameValue( h, expected[ i ], 2 ), true, 'returns expected value' );
}
t.end();
});
Expand Down