Skip to content

Commit a39ced0

Browse files
authored
avoid overflow in division
1 parent 039e275 commit a39ced0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lapack/getf2/zgetf2_k.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa,
105105
temp1 = *(b + jp * 2 + 0);
106106
temp2 = *(b + jp * 2 + 1);
107107

108-
if ((temp1 != ZERO) || (temp2 != ZERO)) {
109-
108+
// if ((temp1 != ZERO) || (temp2 != ZERO)) {
109+
if ((fabs(temp1) > 1.e-305) || (fabs(temp2) > 1.e-305)) {
110+
110111
if (jp != j) {
111112
SWAP_K(j + 1, 0, 0, ZERO, ZERO, a + j * 2, lda,
112113
a + jp * 2, lda, NULL, 0);

0 commit comments

Comments
 (0)