Skip to content

Commit efbac2e

Browse files
committed
refactor: fix C implementation
--- 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 d16677b commit efbac2e

File tree

2 files changed

+6
-7
lines changed
  • lib/node_modules/@stdlib/math/base/special/kernel-log1pf/src

2 files changed

+6
-7
lines changed

lib/node_modules/@stdlib/math/base/special/kernel-log1pf/src/addon.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@
1919
#include "stdlib/math/base/special/kernel_log1pf.h"
2020
#include "stdlib/math/base/napi/unary.h"
2121

22-
// cppcheck-suppress shadowFunction
2322
STDLIB_MATH_BASE_NAPI_MODULE_F_F( stdlib_base_kernel_log1pf )

lib/node_modules/@stdlib/math/base/special/kernel-log1pf/src/main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* ## Notice
2020
*
21-
* The following copyright, license, and long comment were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/12.2.0/lib/msun/src/k_log.c}. The implementation follows the original, but has been modified according to project conventions.
21+
* The following copyright, license, and long comment were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/12.2.0/lib/msun/src/k_logf.h}. The implementation follows the original, but has been modified according to project conventions.
2222
*
2323
* ```text
2424
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -50,7 +50,7 @@
5050
* @return evaluated polynomial
5151
*/
5252
static float polyval_p( const float x ) {
53-
return 0.40000972152 + (x * 0.24279078841);
53+
return 0.40000972152f + (x * 0.24279078841f);
5454
}
5555

5656
// END: polyval_p
@@ -70,15 +70,15 @@ static float polyval_p( const float x ) {
7070
* @return evaluated polynomial
7171
*/
7272
static float polyval_q( const float x ) {
73-
return 0.66666662693 + (x * 0.28498786688);
73+
return 0.66666662693f + (x * 0.28498786688f);
7474
}
7575

7676
// END: polyval_q
7777

7878
/* End auto-generated functions. */
7979

8080
/**
81-
* Computes `logf(1+f) - f` for `1+f` in `~[sqrtf(2)/2, sqrtf(2)]`.
81+
* Computes `log(1+f) - f` for `1+f` in `~[sqrt(2)/2, sqrt(2)]` as a single-precision floating-point number.
8282
*
8383
* ## Method
8484
*
@@ -154,10 +154,10 @@ static float polyval_q( const float x ) {
154154
* where \\(n \cdot \operatorname{ln2}_{hi}\\) is always exact for \\(|n| < 2000\\).
155155
*
156156
* @param f input value
157-
* @return output value
157+
* @return function value
158158
*
159159
* @example
160-
* float out = stdlib_base_kernel_log1p( 1.0f );
160+
* float out = stdlib_base_kernel_log1pf( 1.0f );
161161
* // returns ~0.1931f
162162
*/
163163
float stdlib_base_kernel_log1pf( const float f ) {

0 commit comments

Comments
 (0)