projects
/
infodrom
/
dtaus
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
30b389e
)
Added support for representing zero
author
Joey Schulze
<joey@infodrom.org>
Mon, 22 Aug 2005 18:07:07 +0000
(18:07 +0000)
committer
Joey Schulze
<joey@infodrom.org>
Mon, 22 Aug 2005 18:07:07 +0000
(18:07 +0000)
bigint.c
patch
|
blob
|
history
diff --git
a/bigint.c
b/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--);
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]);
for (i=0; i<max; i++) {
if (i<max-1)
sprintf(tmp, form, a.val[i]);