-
Notifications
You must be signed in to change notification settings - Fork 0
/
HyperInt.h
45 lines (39 loc) · 1.43 KB
/
HyperInt.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
/*
* HyperInt.h
*
* Created on: 2014-03-07
* Author: Ryan
*/
#ifndef HYPERINT_H_
#define HYPERINT_H_
#include <vector>
#include <iostream>
using namespace std;
class HyperInt{
friend const bool operator== (const HyperInt & left, const HyperInt & right);
friend const bool operator!= (const HyperInt & left, const HyperInt & right);
friend const bool operator< (const HyperInt & left, const HyperInt & right);
friend const bool operator> (const HyperInt & left, const HyperInt & right);
friend const bool operator<= (const HyperInt & left, const HyperInt & right);
friend const bool operator>= (const HyperInt & left, const HyperInt & right);
friend istream & operator>> (istream & is, HyperInt & num);
friend ostream & operator<< (ostream& os,const HyperInt & num);
public:
HyperInt();
HyperInt(long num);
HyperInt(string num);
HyperInt(const HyperInt& otherInt);
const HyperInt & operator+= (const HyperInt & right);
const HyperInt & operator*= (const HyperInt & right);
const HyperInt operator^ (int e)const;
const HyperInt operator^ (const HyperInt& e)const;
HyperInt & operator=(const HyperInt & other);
operator bool() const;
HyperInt& operator++();
HyperInt operator++(int);
private:
vector<int> nums;
};
const HyperInt operator+ (const HyperInt & left, const HyperInt & right);
const HyperInt operator* (const HyperInt & left, const HyperInt & right);
#endif /* HYPERINT_H_ */