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
18 changes: 17 additions & 1 deletion lib/node_modules/@stdlib/math/base/special/sinpi/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ 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 isSameValue = require( '@stdlib/assert/is-same-value' );
var sinpi = require( './../lib/' );


Expand Down Expand Up @@ -67,7 +68,22 @@ tape( 'if provided an integer, the function returns `+-0`', function test( t ) {
expected = integers.expected;
for ( i = 0; i < x.length; i++ ) {
y = sinpi( x[i] );
t.equal( y, expected[ i ], 'returns '+expected[i] );
t.equal( isSameValue( y, expected[ i ] ), true, 'returns '+expected[ i ] );
}
t.end();
});

tape( 'the function is odd', function test( t ) {
var expected;
var x;
var y;
var i;

x = decimals.x;
for ( i = 0; i < x.length; i++ ) {
y = sinpi( -x[i] );
expected = -sinpi( x[i] );
t.equal( y, expected, 'returns '+expected );
}
t.end();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ 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 isSameValue = require( '@stdlib/assert/is-same-value' );
var tryRequire = require( '@stdlib/utils/try-require' );


Expand Down Expand Up @@ -76,7 +77,22 @@ tape( 'if provided an integer, the function returns `+-0`', opts, function test(
expected = integers.expected;
for ( i = 0; i < x.length; i++ ) {
y = sinpi( x[i] );
t.equal( y, expected[ i ], 'returns '+expected[i] );
t.equal( isSameValue( y, expected[ i ] ), true, 'returns '+expected[ i ] );
}
t.end();
});

tape( 'the function is odd', opts, function test( t ) {
var expected;
var x;
var y;
var i;

x = decimals.x;
for ( i = 0; i < x.length; i++ ) {
y = sinpi( -x[i] );
expected = -sinpi( x[i] );
t.equal( y, expected, 'returns '+expected );
}
t.end();
});
Expand Down