Skip to content

Commit

Permalink
Add NaN tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-frbg authored Aug 14, 2023
1 parent 43f5e42 commit 9a8d090
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/arm/iamax.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
BLASLONG max=0;

if (n <= 0 || inc_x <= 0) return(max);

if (n==1) return(1);
if (x[0]!=x[0]) return(1);
maxf=ABS(x[0]);
ix += inc_x;
i++;

while(i < n)
{
if (x[ix]!=x[ix]) return(i+1);
if( ABS(x[ix]) > maxf )
{
max = i;
Expand Down

0 comments on commit 9a8d090

Please sign in to comment.