Added basic integer prototype

This commit is contained in:
Robert 2020-07-18 21:06:17 +02:00
parent 0061f9692f
commit 95282f7d1a
7 changed files with 162 additions and 6 deletions

28
include/gm3p_int.hpp Normal file
View file

@ -0,0 +1,28 @@
#pragma once
#include "gmp.h"
namespace gm3p
{
class gInt
{
public:
gInt();
gInt(mpz_t init);
gInt(long int init);
gInt(const char* init, int base);
~gInt();
gInt& operator=(const gInt& other);
friend gInt operator+(const gInt& left, const gInt& right);
friend gInt operator-(const gInt& left, const gInt& right);
friend gInt operator*(const gInt& left, const gInt& right);
friend gInt operator/(const gInt& left, const gInt& right);
friend std::ostream& operator<<(std::ostream& os, const gInt& value);
private:
mpz_t value;
};
}