-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInteger.h
More file actions
31 lines (26 loc) · 811 Bytes
/
Integer.h
File metadata and controls
31 lines (26 loc) · 811 Bytes
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
#ifndef INTEGER_H
#define INTEGER_H
#include <math.h>
class Integer
{
friend Integer operator+(const Integer&, const Integer&);
friend Integer operator-(const Integer&, const Integer&);
friend Integer operator*(const Integer&, const Integer&);
public:
Integer();
Integer(const int);
~Integer();
int Get() const;
void Set(const int);
static void SetMultiplyMethod(bool = false);
static Integer restar(const Integer&, const Integer&);
protected:
int* array;
int size;
int calculateDigits(int);
Integer multiplyBy10n(int) const;
static Integer (*multiply)(const Integer&, const Integer&);
static Integer NormalMultiply(const Integer&, const Integer&);
static Integer KaratsubaMultiply(const Integer&, const Integer&);
};
#endif // INTEGER_H