Skip to content

Commit 68a9929

Browse files
committed
test: add tests for IEEE 754-2019 compliance
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 633dc6b commit 68a9929

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

lib/node_modules/@stdlib/math/base/special/tand/test/test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ var abs = require( '@stdlib/math/base/special/abs' );
2626
var EPS = require( '@stdlib/constants/float64/eps' );
2727
var PINF = require( '@stdlib/constants/float64/pinf' );
2828
var NINF = require( '@stdlib/constants/float64/ninf' );
29+
var isPositiveZero = require( '@stdlib/assert/is-positive-zero' );
30+
var isNegativeZero = require( '@stdlib/assert/is-negative-zero' );
2931
var tand = require( './../lib' );
3032

3133

@@ -120,3 +122,15 @@ tape( 'if provided `-90.0`, the function returns `-Infinity`', function test( t
120122
t.equal( v, NINF, 'returns expected value' );
121123
t.end();
122124
});
125+
126+
tape( 'the function returns `-0` if provided `-0`', function test( t ) {
127+
var v = tand( -0.0 );
128+
t.strictEqual( isNegativeZero( v ), true, 'returns expected value' );
129+
t.end();
130+
});
131+
132+
tape( 'the function returns `+0` if provided `+0`', function test( t ) {
133+
var v = tand( 0.0 );
134+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
135+
t.end();
136+
});

lib/node_modules/@stdlib/math/base/special/tand/test/test.native.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ var abs = require( '@stdlib/math/base/special/abs' );
2727
var EPS = require( '@stdlib/constants/float64/eps' );
2828
var PINF = require( '@stdlib/constants/float64/pinf' );
2929
var NINF = require( '@stdlib/constants/float64/ninf' );
30+
var isPositiveZero = require( '@stdlib/assert/is-positive-zero' );
31+
var isNegativeZero = require( '@stdlib/assert/is-negative-zero' );
3032
var tryRequire = require( '@stdlib/utils/try-require' );
3133

3234

@@ -129,3 +131,15 @@ tape( 'if provided `-90.0`, the function returns `-Infinity`', opts, function te
129131
t.equal( v, NINF, 'returns expected value' );
130132
t.end();
131133
});
134+
135+
tape( 'the function returns `-0` if provided `-0`', opts, function test( t ) {
136+
var v = tand( -0.0 );
137+
t.strictEqual( isNegativeZero( v ), true, 'returns expected value' );
138+
t.end();
139+
});
140+
141+
tape( 'the function returns `+0` if provided `+0`', opts, function test( t ) {
142+
var v = tand( 0.0 );
143+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
144+
t.end();
145+
});

0 commit comments

Comments
 (0)