/*
bigint.c - Manage big positive integer numbers
- Copyright (c) 1996 Martin Schulze <joey@artis.uni-oldenburg.de>
+ Copyright (c) 1996,2001,5 Martin Schulze <joey@infodrom.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
tmp = a.val[i] + b.val[i];
if (tmp >= BIGINT_MAX) {
c.val[i] = tmp - BIGINT_MAX;
- if (i<BIGINT_LEN)
+ if (i<BIGINT_LEN-1)
a.val[i+1]++;
else
fprintf(stderr, "Overflow in bigint addition.");
char form[6];
int i, max;
- bzero(s, sizeof(s));
+ memset (s, 0, sizeof(s));
sprintf(form, "%%0%dlu", BIGINT_PREC);
max = BIGINT_LEN;
for (;max>0 && !a.val[max-1];max--);