This repository has been archived on 2025-02-26. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Pivot/include/BigInt.h
2024-05-11 19:44:32 +02:00

49 lines
899 B
C++

#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;
};