Merge branch 'master' of git.ucc.asn.au:ipdf/code
[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                 
31                 for (unsigned j = 0; j < 5; ++j)
32                 {
33                         arb_a /= b;
34                         gmp_a /= b;
35                 }
36                 
37                 
38         }
39         return 0;
40 }

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