summaryrefslogtreecommitdiff
path: root/libguile/numbers.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/numbers.c')
-rw-r--r--libguile/numbers.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libguile/numbers.c b/libguile/numbers.c
index 09b81c7da..53a40a0bd 100644
--- a/libguile/numbers.c
+++ b/libguile/numbers.c
@@ -2288,6 +2288,12 @@ big2str (SCM b, unsigned int radix)
SCM_BIGDIG radpow = 1, radmod = 0;
SCM ss = scm_allocate_string (j);
char *s = SCM_STRING_CHARS (ss), c;
+
+ if (i == 0)
+ {
+ return scm_makfrom0str ("0");
+ }
+
while ((long) radpow * radix < SCM_BIGRAD)
{
radpow *= radix;