Skip to content

Commit 4c5e486

Browse files
committed
fix: update implementation to preserve signed zeros
--- 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: passed - 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: 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 95641f7 commit 4c5e486

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/node_modules/@stdlib/blas/ext/base/gsumpw/lib/accessors.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ function gsumpw( N, x, strideX, offsetX ) {
8989
}
9090

9191
if ( N <= 8 ) {
92-
s = 0.0;
93-
for ( i = 0; i < N; i++ ) {
92+
s = get( xbuf, ix );
93+
ix += strideX;
94+
for ( i = 1; i < N; i++ ) {
9495
s += get( xbuf, ix );
9596
ix += strideX;
9697
}

lib/node_modules/@stdlib/blas/ext/base/gsumpw/lib/ndarray.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ function gsumpw( N, x, strideX, offsetX ) {
8585
}
8686
if ( N < 8 ) {
8787
// Use simple summation...
88-
s = 0.0;
89-
for ( i = 0; i < N; i++ ) {
88+
s = x[ ix ];
89+
ix += strideX;
90+
for ( i = 1; i < N; i++ ) {
9091
s += x[ ix ];
9192
ix += strideX;
9293
}

0 commit comments

Comments
 (0)