Add NaN tests

This commit is contained in:
Martin Kroeker 2023-08-14 23:14:32 +02:00 committed by GitHub
parent f986829698
commit 2e68d922d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -56,13 +56,15 @@ BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
BLASLONG min=0; BLASLONG min=0;
if (n <= 0 || inc_x <= 0) return(min); if (n <= 0 || inc_x <= 0) return(min);
if (n==1) return(1);
minf=ABS(x[0]); if (x[0]!=x[0]) return(1);
minf=ABS(x[0]);
ix += inc_x; ix += inc_x;
i++; i++;
while(i < n) while(i < n)
{ {
if (x[ix]!=x[ix]) return(i+1);
if( ABS(x[ix]) < ABS(minf) ) if( ABS(x[ix]) < ABS(minf) )
{ {
min = i; min = i;