Now with GNU MultiPrecision (GMP) integers
[ipdf/code.git] / src / tests / arbint_vs_gmpint.cpp
1 #include <gmp.h>
2 #include <stdlib.h>
3 #include <stdio.h>
4
5 #include "log.h"
6
7 #include "gmpint.h"
8 #include "arbint.h"
9
10 #define TEST_CASES 100
11
12 using namespace IPDF;
13
14 int main(int argc, char ** argv)
15 {
16         for (unsigned i = 0; i < TEST_CASES; ++i)
17         {
18                 uint64_t a = rand();
19         
20                 Arbint arb_a(a);
21                 Gmpint gmp_a(a);
22                 
23                 uint64_t b = rand();
24                 
25                 for (unsigned j = 0; j < 5; ++j)
26                 {
27                         arb_a *= b;
28                         gmp_a *= b;
29                         
30                         Debug("Arbint - %s", arb_a.Str().c_str());
31                         Debug("Gmpint - %s", gmp_a.Str().c_str());
32                 }
33                 
34                 
35         }
36         return 0;
37 }

UCC git Repository :: git.ucc.asn.au