1 #include <cln/number.h>
3 #include <cln/integer.h>
4 #include <cln/random.h>
7 #include <cln/timing.h>
9 #include <cln/malloc.h>
11 int main (int argc, char * argv[])
14 if ((argc >= 3) && !strcmp(argv[1],"-r")) {
15 repetitions = atoi(argv[2]);
20 cl_I m = cl_I(argv[1]);
21 cl_I M = (cl_I)1 << (intDsize*m);
23 extern int cl_digits_algo;
24 // One run to fill the cache.
26 char* p = (cl_digits_algo = 0, cl_decimal_string(a));
27 char* q = (cl_digits_algo = 1, cl_decimal_string(a));
28 if (strcmp(p,q)) abort();
32 // Now start the timing.
35 for (int rep = repetitions; rep > 0; rep--)
36 { char* p = cl_decimal_string(a); free_hook(p); }
40 for (int rep = repetitions; rep > 0; rep--)
41 { char* p = cl_decimal_string(a); free_hook(p); }