Skip to content

Commit 7d24f69

Browse files
committed
fix: use correct imports and remove redundant 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: 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 84eb082 commit 7d24f69

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@
3737
"libpath": [],
3838
"dependencies": [
3939
"@stdlib/math/base/napi/unary",
40-
"@stdlib/math/base/assert/is-nanf",
41-
"@stdlib/math/base/assert/is-integerf",
42-
"@stdlib/math/base/assert/is-evenf",
40+
"@stdlib/math/base/assert/int32-is-even",
4341
"@stdlib/constants/float32/pinf",
4442
"@stdlib/constants/float32/max-nth-double-factorial"
4543
]
@@ -55,9 +53,7 @@
5553
"libraries": [],
5654
"libpath": [],
5755
"dependencies": [
58-
"@stdlib/math/base/assert/is-nanf",
59-
"@stdlib/math/base/assert/is-integerf",
60-
"@stdlib/math/base/assert/is-evenf",
56+
"@stdlib/math/base/assert/int32-is-even",
6157
"@stdlib/constants/float32/pinf",
6258
"@stdlib/constants/float32/max-nth-double-factorial"
6359
]
@@ -73,9 +69,7 @@
7369
"libraries": [],
7470
"libpath": [],
7571
"dependencies": [
76-
"@stdlib/math/base/assert/is-nanf",
77-
"@stdlib/math/base/assert/is-integerf",
78-
"@stdlib/math/base/assert/is-evenf",
72+
"@stdlib/math/base/assert/int32-is-even",
7973
"@stdlib/constants/float32/pinf",
8074
"@stdlib/constants/float32/max-nth-double-factorial"
8175
]

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
*/
1818

1919
#include "stdlib/math/base/special/factorial2f.h"
20-
#include "stdlib/math/base/assert/is_nanf.h"
21-
#include "stdlib/math/base/assert/is_integerf.h"
22-
#include "stdlib/math/base/assert/is_evenf.h"
20+
#include "stdlib/math/base/assert/int32_is_even.h"
2321
#include "stdlib/constants/float32/pinf.h"
2422
#include "stdlib/constants/float32/max_nth_double_factorial.h"
2523
#include <stdint.h>
@@ -39,19 +37,16 @@ float stdlib_base_factorial2f( const int32_t n ) {
3937
int32_t i;
4038
float out;
4139

42-
if ( stdlib_base_is_nanf( n ) ) {
43-
return 0.0f / 0.0f; // NaN
44-
}
4540
if ( n > STDLIB_CONSTANT_FLOAT32_MAX_NTH_DOUBLE_FACTORIAL ) {
4641
return STDLIB_CONSTANT_FLOAT32_PINF;
4742
}
48-
if ( n < 0 || !stdlib_base_is_integerf( n ) ) {
43+
if ( n < 0 ) {
4944
return 0.0f / 0.0f; // NaN
5045
}
5146
if ( n == 0 || n == 1 ) {
5247
return 1.0f;
5348
}
54-
if ( stdlib_base_is_evenf( n ) ) {
49+
if ( stdlib_base_int32_is_even( n ) ) {
5550
last = 2;
5651
} else {
5752
last = 3;

0 commit comments

Comments
 (0)