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;