-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbigInt.h
47 lines (41 loc) · 810 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
#ifndef BIGINT_H
#define BIGINT_H
#include <limits>
#include <string>
#include <cmath>
using namespace std;
namespace xmath {
const int MAX_CHIPER = UINT_MAX;
class bigInt
{
public:
bigInt();
bigInt(const unsigned int n);
~bigInt();
unsigned int getChipers() { return chiper; }
//toString
string toStr();
//toInt
int toInt();
//toll
long long toll();
//acc
bigInt& operator+(bigInt &op);
//min
bigInt& operator-(bigInt &op);
//product
bigInt& operator*(bigInt &op);
//div
bigInt& operator/(bigInt &op);
//comp
bool operator==(const bigInt &op) const;
bool operator<(const bigInt &op) const;
bool operator>(const bigInt &op) const;
private:
bool sign; //true : pos, false : neg
void* number;
unsigned int chiper;
unsigned int bytes;
};
}
#endif