@@ -10,6 +10,9 @@ class HugeInt {
1010 int depth;
1111 bool negative;
1212
13+ void normalize (); // приводим число к 10-чной системе счисления
14+ void shrink_to_fit (); // обрезаем ненужные нули
15+
1316 int compare (HugeInt &b) const ;
1417 HugeInt simple_sum (HugeInt &b);
1518 HugeInt simple_dif (HugeInt &b);
@@ -21,18 +24,23 @@ class HugeInt {
2124 HugeInt (int depth);
2225 HugeInt (int numbers[40 ], int depth);
2326
24- void set (std::string str); // set для массива цифр
25- void set (int numbers[40 ]); // set для массива цифр
26- std::string to_str () const ; // get для массива цифр
27+ void set (std::string str); // set для массива цифр
28+ void set (int numbers[40 ]); // set для массива цифр
29+ std::string to_str () const ; // get для массива цифр
2730
2831 void set_minus (bool state); // set для знака
2932 bool has_minus () const ; // get для знака
3033 void set_depth (int dep); // set для длины числа
3134 int get_depth () const ; // get для длины числа
35+ bool check_zero () const ;
3236
3337 void set_digit (int index, int digit); // set для разряда числа
3438 int get_digit (int index) const ; // get для разряда числа
3539
40+ // операторы
41+
42+ HugeInt operator -() const ;
43+
3644 friend bool operator == (HugeInt &n1, HugeInt &n2);
3745 friend bool operator != (HugeInt &n1, HugeInt &n2);
3846
@@ -44,17 +52,13 @@ class HugeInt {
4452
4553 friend HugeInt operator +(HugeInt &n1, HugeInt &n2);
4654 friend HugeInt operator -(HugeInt &n1, HugeInt &n2);
55+ friend HugeInt operator *(HugeInt &n1, HugeInt &n2);
4756
48- bool check_zero () const ;
49-
50- // операторы
51- HugeInt operator -() const ;
52-
53- void shrink_to_fit (); // обрезаем ненужные нули
57+
5458
5559 friend std::ostream& operator <<(std::ostream &out, const HugeInt &n);
5660 friend std::istream& operator >>(std::istream &in, HugeInt &n);
57- // ? тест
61+
5862 void print_full (); // ? print для теста
5963 void print (); // ? print для теста
6064};
0 commit comments