Finished operator overloading
This commit is contained in:
parent
97125eaf07
commit
971f13a59b
3 changed files with 91 additions and 11 deletions
|
@ -12,13 +12,20 @@ namespace gm3p
|
|||
// CONSTRUCTORS
|
||||
gInt();
|
||||
gInt(mpz_t init);
|
||||
gInt(mpq_t init);
|
||||
gInt(mpf_t init);
|
||||
gInt(unsigned long int init);
|
||||
gInt(long int init);
|
||||
gInt(const char* init, int base);
|
||||
gInt(double init);
|
||||
|
||||
// DESTRUCTOR
|
||||
~gInt();
|
||||
|
||||
// ASSIGNMENT OPERATORS
|
||||
// ASSIGNMENT/COPY OPERATORS
|
||||
gInt& operator=(const gInt& other);
|
||||
gInt(const gInt& other);
|
||||
gInt(gInt&& other);
|
||||
|
||||
// ARITHMETIC OPERATORS
|
||||
friend gInt operator+(const gInt& left, const gInt& right);
|
||||
|
@ -31,6 +38,15 @@ namespace gm3p
|
|||
gInt& operator*=(const gInt& right);
|
||||
gInt& operator/=(const gInt& right);
|
||||
|
||||
// CONVERSION OPERATORS
|
||||
operator long int() const;
|
||||
|
||||
unsigned long int ToUnsigned() const;
|
||||
char* ToString(char* buf, int base) const;
|
||||
double ToDouble() const;
|
||||
double ToDouble(long int* exp) const;
|
||||
|
||||
// STDIO OPERATORS
|
||||
friend std::ostream& operator<<(std::ostream& os, const gInt& value);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue