Skip to content

Commit

Permalink
fix: apply code review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
headlessNode committed Oct 11, 2024
1 parent a939dfd commit cb32fbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,14 @@ function dnannsumkbn2( N, x, strideX, offsetX, out, strideOut, offsetOut ) {
var n;
var i;

ix = offsetX;
io = offsetOut;

sum = 0.0;
io = offsetOut;
if ( N <= 0 ) {
out[ io ] = sum;
out[ io+strideOut ] = 0;
return out;
}
ix = offsetX;
if ( strideX === 0 ) {
if ( isnan( x[ ix ] ) ) {
out[ io ] = sum;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* limitations under the License.
*/

#include "stdlib/strided/base/stride2offset.h"
#include "stdlib/blas/ext/base/dnannsumkbn2.h"
#include "stdlib/strided/base/stride2offset.h"
#include "stdlib/math/base/assert/is_nan.h"
#include "stdlib/math/base/special/abs.h"
#include "stdlib/blas/base/shared.h"
Expand Down Expand Up @@ -78,15 +78,15 @@ double API_SUFFIX(stdlib_strided_dnannsumkbn2_ndarray)( const CBLAS_INT N, const
if ( N <= 0 ) {
return sum;
}
ix = offsetX;
if ( strideX == 0 ) {
if ( stdlib_base_is_nan( X[ 0 ] ) ) {
if ( stdlib_base_is_nan( X[ ix ] ) ) {
return sum;
}
sum = X[ 0 ] * N;
sum = X[ ix ] * N;
*n += N;
return sum;
}
ix = offsetX;
ccs = 0.0; // second order correction term for lost lower order bits
cs = 0.0; // first order correction term for lost low order bits
for ( i = 0; i < N; i++ ) {
Expand Down

0 comments on commit cb32fbe

Please sign in to comment.