Skip to content

Commit c73d756

Browse files
committed
fix: remove unnecessary parameter checks for int32_t in factorial2
--- 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: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - 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 b2e273f commit c73d756

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

lib/node_modules/@stdlib/math/base/special/factorial2/manifest.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
"libpath": [],
3838
"dependencies": [
3939
"@stdlib/math/base/napi/unary",
40-
"@stdlib/math/base/assert/is-nan",
41-
"@stdlib/math/base/assert/is-integer",
4240
"@stdlib/math/base/assert/is-even",
4341
"@stdlib/constants/float64/pinf",
4442
"@stdlib/constants/float64/max-nth-double-factorial"
@@ -55,8 +53,6 @@
5553
"libraries": [],
5654
"libpath": [],
5755
"dependencies": [
58-
"@stdlib/math/base/assert/is-nan",
59-
"@stdlib/math/base/assert/is-integer",
6056
"@stdlib/math/base/assert/is-even",
6157
"@stdlib/constants/float64/pinf",
6258
"@stdlib/constants/float64/max-nth-double-factorial"
@@ -73,8 +69,6 @@
7369
"libraries": [],
7470
"libpath": [],
7571
"dependencies": [
76-
"@stdlib/math/base/assert/is-nan",
77-
"@stdlib/math/base/assert/is-integer",
7872
"@stdlib/math/base/assert/is-even",
7973
"@stdlib/constants/float64/pinf",
8074
"@stdlib/constants/float64/max-nth-double-factorial"

lib/node_modules/@stdlib/math/base/special/factorial2/src/main.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
*/
1818

1919
#include "stdlib/math/base/special/factorial2.h"
20-
#include "stdlib/math/base/assert/is_nan.h"
21-
#include "stdlib/math/base/assert/is_integer.h"
2220
#include "stdlib/math/base/assert/is_even.h"
2321
#include "stdlib/constants/float64/pinf.h"
2422
#include "stdlib/constants/float64/max_nth_double_factorial.h"
@@ -39,13 +37,10 @@ double stdlib_base_factorial2( const int32_t n ) {
3937
double out;
4038
int32_t v;
4139
int32_t i;
42-
if ( stdlib_base_is_nan( n ) ) {
43-
return 0.0/0.0; // NaN
44-
}
4540
if ( n > STDLIB_CONSTANT_FLOAT64_MAX_NTH_DOUBLE_FACTORIAL ) {
4641
return STDLIB_CONSTANT_FLOAT64_PINF;
4742
}
48-
if ( n < 0 || !stdlib_base_is_integer( n ) ) {
43+
if ( n < 0 ) {
4944
return 0.0/0.0;
5045
}
5146
v = n;

0 commit comments

Comments
 (0)