ht's Scheme Interpreter  1.0
a simplified scheme interpreter implementation
biginttest.cpp
Go to the documentation of this file.
1 #include "utility/bigint.hpp"
2 #include <iostream>
3 #include <string>
4 using namespace std;
5 
6 int main()
7 {
8  BigInt a(24324215), b("-2432415455435");
9  cout<<a<<endl;
10  cout<<b<<endl;
11  cout<<(a += b)<<endl;
12  cout<< a+123 <<endl;
13  cout<< a-12450 <<endl;
14  BigInt c;
15  for (int i=0;i<10;++i)
16  {
17  c*=10;
18  c+=i;
19  }
20  cout<<c<<endl;
21  cout << c* -c <<endl;
22  cout<< (BigInt(2247192) > 12345) <<endl;
23  cout << c/276 <<endl;
24  cout << c%277 <<endl;
25 
26  BigInt d("1234567890123456789"), e("277277277");
27  cout<<d%e<<endl;
28  return 0;
29 }
BigInt(const std::string &s)
Definition: bigint.cpp:25
BigInt operator*(const BigInt &b) const
Definition: bigint.cpp:278
bool operator>(const BigInt &b) const
Definition: bigint.cpp:133
BigInt(long long num)
Definition: bigint.cpp:20
BigInt & operator+=(const BigInt &b)
Definition: bigint.cpp:202
BigInt operator/(const BigInt &b) const
Definition: bigint.cpp:358
BigInt & operator*=(const BigInt &b)
Definition: bigint.cpp:303
BigInt operator-() const
Definition: bigint.cpp:95
int main()
BigInt operator%(const BigInt &b) const
Definition: bigint.cpp:370
BigInt operator+(const BigInt &b) const
Definition: bigint.cpp:264
BigInt operator-(const BigInt &b) const
Definition: bigint.cpp:271