commit | 0bfcf7a6086427547d37dd7a84e3bc757e6335a2 | [log] [tgz] |
---|---|---|
author | Gavin Howard <yzena.tech@gmail.com> | Thu Oct 11 09:37:09 2018 -0600 |
committer | Gavin Howard <yzena.tech@gmail.com> | Thu Oct 11 09:37:09 2018 -0600 |
tree | 9e968049c46717e669bd25e41864a3fee15fd992 | |
parent | c3137f5bca6466a551fc784168c978baf80be6fa [diff] [blame] |
Fix a math in sqrt
diff --git a/src/num.c b/src/num.c index 450f452..969d472 100644 --- a/src/num.c +++ b/src/num.c
@@ -1157,7 +1157,7 @@ resrdx = scale + 2; len = BC_NUM_INT(x0) + resrdx - 1; - while (!bcg.signe && cmp && digits <= len) { + while (!bcg.signe && (cmp || digits < len)) { if ((s = bc_num_div(a, x0, &f, resrdx))) goto err; if ((s = bc_num_add(x0, &f, &fprime, resrdx))) goto err; @@ -1170,7 +1170,6 @@ else times = 0; resrdx += times > 4; - len += times > 4; cmp2 = cmp1; cmp1 = cmp;