-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBigInt.h
More file actions
61 lines (45 loc) · 1.44 KB
/
BigInt.h
File metadata and controls
61 lines (45 loc) · 1.44 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
#pragma once
#include <iostream>
#define string std::string
#define ll long long
class BigInt {
private:
string digits;
void removeZeroes();
public:
// constructors
BigInt(string);
BigInt(unsigned ll n=0);
BigInt(const BigInt&);
// operators
friend std::ostream& operator<<(std::ostream&, const BigInt&);
friend std::istream& operator>>(std::istream&, BigInt&);
BigInt& operator=(const BigInt&);
BigInt& operator+=(BigInt);
BigInt operator+(const BigInt&) const;
void operator++();
void operator++(int);
BigInt& operator-=(BigInt);
BigInt operator-(const BigInt&) const;
void operator--();
void operator--(int);
BigInt& operator*=(const BigInt&);
BigInt operator*(const BigInt&) const;
BigInt& operator/=(const BigInt&);
BigInt operator/(const BigInt&) const;
BigInt& operator^=(const BigInt&);
BigInt operator^(const BigInt&) const;
BigInt& operator%=(const BigInt&);
BigInt operator%(const BigInt&) const;
bool operator==(const BigInt&) const;
bool operator!=(const BigInt&) const;
bool operator>(const BigInt&) const;
bool operator>=(const BigInt&) const;
bool operator<(const BigInt&) const;
bool operator<=(const BigInt&) const;
char operator[](const int&) const;
// Fuctions
int Length() const;
};
BigInt factorial(int);
BigInt sqrt(const BigInt&);