From 20016a0096fb9c185739476f44650f254881580e Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Tue, 12 Mar 2024 15:48:55 +0100 Subject: [PATCH] fix loop condition for incx < 0 --- kernel/riscv64/nrm2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/riscv64/nrm2.c b/kernel/riscv64/nrm2.c index 8cc189fe30..0b6323f294 100644 --- a/kernel/riscv64/nrm2.c +++ b/kernel/riscv64/nrm2.c @@ -61,7 +61,7 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) if ( n == 1 ) return( ABS(x[0]) ); n *= inc_x; - while(i < n) + while(abs(i) < abs(n)) { if ( x[i] != 0.0 )