Added support for representing zero
authorJoey Schulze <joey@infodrom.org>
Mon, 22 Aug 2005 18:07:07 +0000 (18:07 +0000)
committerJoey Schulze <joey@infodrom.org>
Mon, 22 Aug 2005 18:07:07 +0000 (18:07 +0000)
bigint.c

index 1b6fa91..2182053 100644 (file)
--- a/bigint.c
+++ b/bigint.c
@@ -99,6 +99,7 @@ void bigint_sprintf (char *res, char *format, bigint a)
   sprintf(form, "%%0%dlu", BIGINT_PREC);
   max = BIGINT_LEN;
   for (;max>0 && !a.val[max-1];max--);
+  if (max == 0) s[0] = '0';
   for (i=0; i<max; i++) {
     if (i<max-1)
       sprintf(tmp, form, a.val[i]);