Browse Source

fix another corner case involving infinity

tags/v0.3.28^2
Martin Kroeker GitHub 1 year ago
parent
commit
ad2b5c67c8
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      kernel/x86_64/zscal.c

+ 6
- 2
kernel/x86_64/zscal.c View File

@@ -278,7 +278,9 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r, FLOAT da_i,
temp0 = NAN;
else
temp0 = -da_i * x[i+1];
x[i+1] = da_i * x[i];
if (!isinf(x[i+1]))
x[i+1] = da_i * x[i];
else x[i+1] = NAN;
x[i] = temp0;
i += inc_x ;
j++;
@@ -412,7 +414,9 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r, FLOAT da_i,
temp0 = -da_i * x[i+1];
if (isinf(x[i]))
temp0 = NAN;
x[i+1] = da_i * x[i];
if (!isinf(x[i+1]))
x[i+1] = da_i * x[i];
else x[i+1] = NAN;
if ( x[i] == x[i]) //preserve NaN
x[i] = temp0;
i += 2 ;


Loading…
Cancel
Save