// P-2 MCS 360 due Mon 4 Oct 2010 : big_nat.h

/* The goal of the second project is to use the STL vector class
   to store and add natural numbers of arbitrary length. 
   Public methods in the class are a constructor, to_string() method,
   and the operator + to add two natural numbers. */

#ifndef BIGNAT_H
#define BIGNAT_H

#include <string>
#include <vector>

class Big_Nat
{
   public:

      Big_Nat( std::string n );
      // constructs a big natural number using the
      // decimal expansion in the string n
      std::string to_string() const;
      // returns a decimal expansion of the
      // big natural number
      Big_Nat operator+( const Big_Nat& other );
      // returns the result of adding this
      // and the other natural number

   private:

      std::vector<size_t> coeff;
      size_t lead;
      // index to most significant coefficient
      static const size_t base_digits = 8;
      static const size_t base = 100000000;
};

#endif

