Skip to content

Commit e761068

Browse files
committed
test: add nan checks
--- 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 2f5dad3 commit e761068

File tree

1 file changed

+10
-0
lines changed
  • lib/node_modules/@stdlib/math/base/special/binomcoeff/test

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ tape( 'main export is a function', function test( t ) {
4242
t.end();
4343
});
4444

45+
tape( 'the function returns `NaN` if provided `NaN` for any parameter', function test( t ) {
46+
var v = binomcoeff( 3, NaN );
47+
t.strictEqual( isnanf( v ), true, 'returns expected value' );
48+
49+
v = binomcoeff( NaN, 2 );
50+
t.strictEqual( isnanf( v ), true, 'returns expected value' );
51+
52+
t.end();
53+
});
54+
4555
tape( 'the function evaluates the binomial coefficient for integers `n` and `k`', function test( t ) {
4656
var expected;
4757
var delta;

0 commit comments

Comments
 (0)