This repository was archived by the owner on Aug 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTLongInt.h
More file actions
73 lines (47 loc) · 1.49 KB
/
TLongInt.h
File metadata and controls
73 lines (47 loc) · 1.49 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//
// Created by art on 20.03.19.
//
#ifndef LAB_6_TLONGINT_H
#define LAB_6_TLONGINT_H
#include <vector>
#include <algorithm>
#include <string>
class TLongInt {
public:
TLongInt(std::string &strNum);
TLongInt(size_t size);
TLongInt(size_t size, int num);
TLongInt();
void operator+=(TLongInt &rhs);
void operator+=(TLongInt &&rhs);
void operator-=(TLongInt &rhs);
void operator-=(TLongInt &&rhs);
bool operator<(TLongInt &&rhs);
bool operator<=(TLongInt &&rhs);
bool operator>(TLongInt &&rhs);
bool operator>=(TLongInt &&rhs);
bool operator!=(TLongInt &&rhs);
bool operator==(TLongInt &&rhs);
bool operator<(TLongInt &rhs);
bool operator<=(TLongInt &rhs);
bool operator>(TLongInt &rhs);
bool operator>=(TLongInt &rhs);
bool operator!=(TLongInt &rhs);
bool operator==(TLongInt &rhs);
TLongInt operator+(TLongInt &rhs);
TLongInt operator+(TLongInt &&rhs);
TLongInt operator-(TLongInt &rhs);
TLongInt operator-(TLongInt &&rhs);
TLongInt operator*(TLongInt &rhs);
TLongInt operator*(TLongInt &&rhs);
TLongInt operator/(TLongInt &rhs);
TLongInt operator^(int num);
size_t Size() const;
friend std::ostream &operator<<(std::ostream &stream, TLongInt &number);
friend std::ostream &operator<<(std::ostream &stream, TLongInt &&number);
static const int BASE = 1000000000;
static const int BASE_SIZE = 9;
private:
std::vector<int> number;
};
#endif //LAB_6_TLONGINT_H