Skip to content

Commit dee8557

Browse files
authored
handle incx < 0
1 parent d9dff17 commit dee8557

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/riscv64/znrm2_vector.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
9696
{
9797
BLASLONG i=0;
9898

99-
if (n <= 0 || inc_x <= 0) return(0.0);
99+
if (n <= 0 || inc_x == 0) return(0.0);
100100

101101
FLOAT_V_T v_ssq, v_scale, v0, v1, v_zero;
102102
unsigned int gvl = 0;
@@ -176,7 +176,7 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
176176
}
177177

178178
i += inc_x*2;
179-
}while(i<n);
179+
}while(abs(i)<abs(n));
180180
}
181181

182182
return(scale * sqrt(ssq));

0 commit comments

Comments
 (0)