summaryrefslogtreecommitdiffstats
path: root/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test.c')
-rw-r--r--test.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/test.c b/test.c
index e2ecc40..00a5ddf 100644
--- a/test.c
+++ b/test.c
@@ -1,55 +1,55 @@
#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
-#include "mpn.h"
+#include "pbn.h"
int main(int argc, char *argv[])
{
uint64_t i, j;
- struct mpn *m, *mj;
+ struct pbn *m, *mj;
int nx = (argc < 2) ? 64 : atoi(argv[1]);
int n;
- m = mpn_int(5);
+ m = pbn_int(5);
i = 5;
n = nx;
while (n--) {
printf("%016"PRIx64" : ", i);
- mpn_dump(stdout, mpn_ref(m));
+ pbn_dump(stdout, pbn_ref(m));
putchar('\n');
i *= 5;
- m = mpn_mul(m, mpn_int(5));
+ m = pbn_mul(m, pbn_int(5));
}
- mpn_free(m);
+ pbn_free(m);
- m = mpn_int(5);
+ m = pbn_int(5);
i = 5;
n = nx;
while (n--) {
printf("%016"PRIx64" : ", i);
- mpn_dump(stdout, mpn_ref(m));
+ pbn_dump(stdout, pbn_ref(m));
putchar('\n');
i += i;
- m = mpn_add(m, mpn_ref(m));
+ m = pbn_add(m, pbn_ref(m));
}
n = nx;
j = 20;
- mj = mpn_int(20);
+ mj = pbn_int(20);
while (n--) {
printf("%016"PRIx64" : ", i);
- mpn_dump(stdout, mpn_ref(m));
+ pbn_dump(stdout, pbn_ref(m));
printf(" : ");
- mpn_dump(stdout, mpn_ref(mj));
+ pbn_dump(stdout, pbn_ref(mj));
putchar('\n');
i -= j;
j += j;
- m = mpn_sub(m, mpn_ref(mj));
- mj = mpn_add(mj, mpn_ref(mj));
+ m = pbn_sub(m, pbn_ref(mj));
+ mj = pbn_add(mj, pbn_ref(mj));
}
return 0;