#ifndef GRAND_ENTIER_H #define GRAND_ENTIER_H #include #include #include "exception.h" #include #include using namespace std; /* * Description : Classe permettant de créer des entiers tres grands. */ class Grandentier { private: // Tableau dynamique d'entiers int * tab; // Taille du tableau int lg; // Test si l'entier est négatif bool negatif; // Convertion d'un Grandentier en "int" friend int convEnInt (const Grandentier &EI); public: // Constructeur sans argument Grandentier(); // Constructeur // nombre : nombre entier Grandentier(int nombre); //constructeur Grandentier(const char *s); Grandentier(const std::string& val); // Constructeur par recopie Grandentier(const Grandentier &EI); // Destructeur ~Grandentier(); // Opérateur d'affectation Grandentier& operator= (const Grandentier &EI); // Opérateurs addition,soustraction,multiplication Grandentier operator+ (const Grandentier &EI); Grandentier operator- (const Grandentier &EI); Grandentier operator* (const Grandentier &EI); // Opérations d'addition, de soustraction, de multiplication, Grandentier addition (const Grandentier &EI); Grandentier soustraction (const Grandentier &EI); Grandentier multiplication (const Grandentier &EI); // Opérateurs de comparaison bool operator== (const Grandentier &EI); bool operator!= (const Grandentier &EI); bool operator< (const Grandentier &EI); bool operator<= (const Grandentier &EI); bool operator> (const Grandentier &EI); bool operator>= (const Grandentier &EI); // Opérateurs d'entrée-sortie friend ostream& operator<< (ostream& sortie,Grandentier & EI); friend istream& operator>> (istream& entree,Grandentier & EI); }; #endif