// Fig. 8.8: hugeint1.h 
// Definition of the HugeInt class
#ifndef HUGEINT1_H
#define HUGEINT1_H

#include <iostream.h>

const int SIZE = 30;
const int MAX_INDEX = SIZE - 1;

class HugeInt {
   friend ostream &operator<<( ostream &, HugeInt & );

   // new 11/98 -bds
   friend HugeInt operator+( int, HugeInt & );          // int + HugeInt
   friend HugeInt operator-( int, HugeInt & );          // int - HugeInt
   friend HugeInt abs( HugeInt & ); // absolute value

public:
   HugeInt( long = 0 );       // conversion/default constructor
   HugeInt( const char * );           // conversion constructor
   HugeInt operator+( HugeInt & );    // add another HugeInt
   HugeInt operator+( int );          // add an int
   HugeInt operator+( const char * ); // add an int in a char *

   // new 11/98 -bds
   HugeInt operator-( HugeInt & );    // subtract another HugeInt
   HugeInt operator-( int );          // subtract an int
   HugeInt operator-( const char * ); // subtract an int in a char *

private:
   short integer[SIZE];

   // new 11/98 -bds
   short sign;
   void negate();// change sign
};

#endif

