Skip to content
Open
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: 13 additions & 0 deletions lib/node_modules/@stdlib/math/base/special/cosm1/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ tape( 'main export is a function', function test( t ) {
t.end();
});

tape( 'the function returns positive zero for zero and negative zero', function test( t ) {
var v1 = cosm1( 0.0 );
var v2 = cosm1( -0.0 );

t.strictEqual( v1, 0.0, 'returns +0 for +0' );
t.strictEqual( 1.0/v1, PINF, 'returns +0 (not -0)' );

t.strictEqual( v2, 0.0, 'returns +0 for -0' );
t.strictEqual( 1.0/v2, PINF, 'returns +0 (not -0)' );

t.end();
});

tape( 'the function computes the cosine minus one more accurately inside the interval [-π/4,π/4]', function test( t ) {
var expected;
var x;
Expand Down