big int
This commit is contained in:
49
include/BigInt.h
Normal file
49
include/BigInt.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <gmp.h>
|
||||
|
||||
/**
|
||||
* \class BigInt
|
||||
* \brief Représente un entier d'une taille quelconque
|
||||
* \warning Prend énormément de place en mémoire. À utiliser avec précaution !
|
||||
*/
|
||||
class BigInt {
|
||||
private:
|
||||
mpz_t m_Data;
|
||||
|
||||
public:
|
||||
BigInt(std::string&& a_Number);
|
||||
|
||||
BigInt(long a_Number = 0);
|
||||
|
||||
BigInt(const BigInt& a_Copy);
|
||||
|
||||
BigInt(BigInt&& a_Move);
|
||||
|
||||
~BigInt();
|
||||
|
||||
BigInt operator+(const BigInt& a_Other);
|
||||
|
||||
BigInt operator-(const BigInt& a_Other);
|
||||
|
||||
BigInt operator*(const BigInt& a_Other);
|
||||
|
||||
BigInt operator/(const BigInt& a_Other);
|
||||
|
||||
BigInt operator+=(const BigInt& a_Other);
|
||||
|
||||
BigInt operator-=(const BigInt& a_Other);
|
||||
|
||||
BigInt operator*=(const BigInt& a_Other);
|
||||
|
||||
BigInt operator/=(const BigInt& a_Other);
|
||||
|
||||
bool operator==(const BigInt& a_Other);
|
||||
|
||||
void operator=(const BigInt& a_Other);
|
||||
|
||||
const std::string ToString() const;
|
||||
|
||||
bool IsEqualZero() const;
|
||||
};
|
||||
Reference in New Issue
Block a user