projects
/
infodrom
/
dtaus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Corrected the bigint_int() routine with regards to large integers (as
[infodrom/dtaus]
/
bigint.c
diff --git
a/bigint.c
b/bigint.c
index
fe963e1
..
99fc7b0
100644
(file)
--- a/
bigint.c
+++ b/
bigint.c
@@
-57,8
+57,13
@@
bigint bigint_int(int num)
int i;
for (i=0; i<BIGINT_LEN; i++) x.val[i] = 0L;
int i;
for (i=0; i<BIGINT_LEN; i++) x.val[i] = 0L;
- x.val[0] = num;
- x.val[1] = 0;
+ if (num < BIGINT_MAX)
+ x.val[0] = num;
+ else {
+ x.val[0] = num-BIGINT_MAX;
+ x.val[1] = num/BIGINT_MAX;
+ }
+
return x;
}
return x;
}