@@ -10,14 +10,20 @@ class HugeInt {
1010 int depth;
1111 bool negative;
1212
13+ int compare (HugeInt &b) const ;
14+ HugeInt simple_sum (HugeInt &b);
15+ HugeInt simple_dif (HugeInt &b);
16+ HugeInt sum (HugeInt &b);
17+ HugeInt dif (HugeInt &b);
18+
1319 public:
1420 HugeInt (); // конструктор по умолчанию
1521 HugeInt (int depth);
1622 HugeInt (int numbers[40 ], int depth);
1723
1824 void set (std::string str); // set для массива цифр
1925 void set (int numbers[40 ]); // set для массива цифр
20- std::string get () const ; // get для массива цифр
26+ std::string to_str () const ; // get для массива цифр
2127
2228 void set_minus (bool state); // set для знака
2329 bool has_minus () const ; // get для знака
@@ -33,15 +39,13 @@ class HugeInt {
3339 friend bool operator > (HugeInt &d1, HugeInt &d2);
3440 friend bool operator <= (HugeInt &d1, HugeInt &d2);
3541
36- friend bool operator < (HugeInt &d1, HugeInt &d2);
37- friend bool operator >= (HugeInt &d1, HugeInt &d2);
42+ friend bool operator < (HugeInt &n1, HugeInt &n2);
43+ friend bool operator >= (HugeInt &n1, HugeInt &n2);
44+
45+ friend HugeInt operator +(HugeInt &n1, HugeInt &n2);
46+ friend HugeInt operator -(HugeInt &n1, HugeInt &n2);
3847
3948 bool check_zero () const ;
40- int compare (HugeInt &b) const ;
41- HugeInt simple_sum (HugeInt &b);
42- HugeInt simple_dif (HugeInt &b);
43- HugeInt sum (HugeInt &b);
44- HugeInt dif (HugeInt &b);
4549
4650 // операторы
4751 HugeInt operator -() const ;
0 commit comments