-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbiginteger.h
81 lines (71 loc) · 2.68 KB
/
biginteger.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef BCHECK
#define BCHECK
#include "bitset.h"
#include <string>
#include <exception>
typedef long l;
typedef unsigned long ul;
typedef long long int ll;
typedef unsigned long long ull;
class BigInteger {
private:
Bitset tape;
void setup_for_signed(ll);
void setup_for_unsigned(ull);
friend BigInteger unsign_shift_left(BigInteger const&, size_t);
friend BigInteger unsign_shift_right(BigInteger const&, size_t);
public:
void increase_tape();
BigInteger();
BigInteger(int);
BigInteger(unsigned int);
BigInteger(l);
BigInteger(ul);
BigInteger(ll);
BigInteger(ull);
BigInteger(std::string);
BigInteger(BigInteger const&);
BigInteger(BigInteger&&);
BigInteger& operator=(BigInteger const&);
BigInteger& operator=(BigInteger&&);
friend bool operator<(BigInteger const&, BigInteger const&);
friend bool operator>(BigInteger const&, BigInteger const&);
friend bool operator<=(BigInteger const&, BigInteger const&);
friend bool operator>=(BigInteger const&, BigInteger const&);
friend bool operator==(BigInteger const&, BigInteger const&);
friend bool operator!=(BigInteger const&, BigInteger const&);
friend BigInteger operator+(BigInteger const&, BigInteger const&);
friend BigInteger operator-(BigInteger const&, BigInteger const&);
friend BigInteger operator*(BigInteger const&, BigInteger const&);
friend BigInteger operator/(BigInteger const&, BigInteger const&);
friend BigInteger operator%(BigInteger const&, BigInteger const&);
BigInteger operator++(int);
BigInteger& operator++();
BigInteger operator--(int);
BigInteger& operator--();
BigInteger& operator+=(BigInteger const&);
BigInteger& operator-=(BigInteger const&);
BigInteger& operator*=(BigInteger const&);
BigInteger& operator/=(BigInteger const&);
BigInteger& operator%=(BigInteger const&);
BigInteger& operator+();
BigInteger operator-();
friend BigInteger operator^(BigInteger const&, BigInteger const&);
friend BigInteger operator&(BigInteger const&, BigInteger const&);
friend BigInteger operator|(BigInteger const&, BigInteger const&);
BigInteger operator<<(size_t);
BigInteger operator>>(size_t);
BigInteger& operator^=(BigInteger const&);
BigInteger& operator|=(BigInteger const&);
BigInteger& operator&=(BigInteger const&);
BigInteger& operator<<=(size_t);
BigInteger& operator>>=(size_t);
BigInteger& operator~();
friend BigInteger negative(BigInteger);
friend BigInteger positive(BigInteger);
friend int GetSign(BigInteger);
friend std::string to_string(BigInteger const&);
bool empty() const;
};
BigInteger negative(BigInteger);
#endif