vimix

bigint.h

May 23rd, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. //Venix Cador
  2. //Cs23001
  3. //02/10/2013
  4.  
  5. #ifndef BIGINT_HEADER
  6. #define BIGINT_HEADER
  7. #include<iostream>
  8.  
  9. const int MaxValue = 100;
  10.  
  11. class bigint
  12.  
  13. {
  14.  
  15. public:
  16.  
  17. bigint();
  18.  
  19. bigint(int);
  20.  
  21. bigint(const char[]);
  22.  
  23. bool operator ==(const bigint&);
  24.  
  25. bool operator ==(int);
  26.  
  27. bool operator ==(const char[]);
  28.  
  29. bool operator != ( const bigint& rhs) { return !(*this == rhs);};
  30.  
  31. int operator[](int);
  32.  
  33. int operator[](int) const;
  34.  
  35. bigint operator+(bigint) const;
  36.  
  37. void output(std::ostream&) const;
  38.  
  39. void times_single_digit(const int );
  40.  
  41. bigint operator*(bigint) const;
  42.  
  43. void times10(const int);
  44.  
  45. bigint operator*(const bigint& rhs);
  46.  
  47. bigint factorial() const;
  48.  
  49. private:
  50.  
  51. int big[MaxValue];
  52.  
  53. int size;
  54.  
  55. void zero();
  56.  
  57. };
  58. std::istream& operator >>(std::istream&, bigint&);
  59. std::ostream& operator <<(std::ostream&,const bigint&);
  60.  
  61. #endif
Advertisement
Add Comment
Please, Sign In to add comment