diff --git a/kernel/power/sscal.c b/kernel/power/sscal.c index 65572a8c1f..12246b0a38 100644 --- a/kernel/power/sscal.c +++ b/kernel/power/sscal.c @@ -74,14 +74,38 @@ static void sscal_kernel_16_zero( BLASLONG n, FLOAT *x ) for( i=0; i> 2) & 0x7; for (j = 0; j < align; j++) { - x[j] = 0.0; + if (isfinite(x[j])) + x[j] = 0.0; + else + x[j] = NAN; } } BLASLONG n1 = (n-j) & -32; @@ -129,8 +156,10 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da, FLOAT *x, BLAS while(j < n) { - - x[j]=0.0; + if (isfinite(x[j])) + x[j]=0.0; + else + x[j]=NAN; j++; } @@ -178,8 +207,10 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da, FLOAT *x, BLAS while(j < n) { - - x[i]=0.0; + if (isfinite(x[i])) + x[i]=0.0; + else + x[i]=NAN; i += inc_x ; j++; }