-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTLongNumber.h
48 lines (34 loc) · 1.17 KB
/
TLongNumber.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
#ifndef TLONGNUMBER_H
#define TLONGNUMBER_H
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
class TLongNumber {
public:
TLongNumber(std::istream &is, int base);
TLongNumber(std::string num, int base);
TLongNumber(std::vector <int> num, int base);
TLongNumber(int size, int base);
TLongNumber(){};
~TLongNumber(){};
int Size () const { return number.size(); }
bool Divisibility(int a) const;
friend std::ostream& operator<<(std::ostream& os, const TLongNumber &a);
bool operator ==(const TLongNumber &x) const;
bool operator > (const TLongNumber &x) const;
bool operator < (const TLongNumber &x) const;
TLongNumber operator + (const TLongNumber &a) const;
TLongNumber operator - (const TLongNumber &a) const;
TLongNumber operator * (const TLongNumber &a) const;
TLongNumber operator / (const TLongNumber &a) const;
TLongNumber operator ^ (const TLongNumber &a) const;
TLongNumber operator * (const int &a) const;
private:
void ShiftUp ();
void ZeroSplit();
int base;
std::vector<int> number;
};
#endif