-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBigInt.h
60 lines (37 loc) · 929 Bytes
/
BigInt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <iostream>
using namespace std;
class MyException : public exception
{
public:
string s;
MyException(string ss) : s(ss) {}
~MyException() throw () {} // Updated
const char* what() const throw() { return s.c_str(); }
};
class BigInt {
public:
BigInt();
BigInt(char *value);
BigInt(const BigInt &other);
~BigInt();
void SetValue(char *value);
BigInt operator+(BigInt n1);
BigInt operator-(BigInt n1);
BigInt operator*(BigInt n1);
BigInt operator*(int n);
BigInt operator/(int n);
BigInt operator/(BigInt n1);
BigInt operator%(BigInt n1);
BigInt operator=(BigInt n1);
bool operator>=(BigInt n1);
bool operator==(BigInt n1);
BigInt normii(BigInt n1);
char* toString();
void Print();
void print_bin();
unsigned long toLong();
operator unsigned long int();
private:
int *numbers;
int length;
};