Finished operator overloading

This commit is contained in:
Robert 2020-07-19 02:06:36 +02:00
parent 97125eaf07
commit 971f13a59b
3 changed files with 91 additions and 11 deletions

View file

@ -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: