summaryrefslogtreecommitdiff
path: root/big.c
diff options
context:
space:
mode:
Diffstat (limited to 'big.c')
-rw-r--r--big.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/big.c b/big.c
index 9f195d3..b438b3b 100644
--- a/big.c
+++ b/big.c
@@ -551,13 +551,15 @@ word longdiv(word x, word y)
}
} /* see Bird & Wadler p82 for explanation */
-word len(x) /* no of digits in big x */
-word x;
+/* no of digits in big x */
+word len(word x)
{
word n = 1;
- while (x = rest(x))
+ while (x = rest(x)) {
n++;
- return (n);
+ }
+
+ return n;
}
word msd(x) /* most significant digit of big x */