title: Dividing large integer by large integer
body: <p>Guys I'm working on class called LINT (large int) for learning purposes, and everything went ok till know. I'm stuck on implementing operator/(const LINT&amp;). The problem here is that in when I want to divide LINT by LINT  I'm getting into recursive fnc invocation i.e:</p>
  
  <pre><code>//unfinished
  LINT_rep LINT_rep::divide_(const LINT_rep&amp; bottom)const
  {
  typedef LINT_rep::Iterator iter;
   iter topBeg = begin();
   iter topEnd = end();
   iter bottomBeg = bottom.begin();
   iter bottomEnd = bottom.end();
  LINT_rep topTmp;//for storing smallest number (dividend) which can be used to divide by divisor
   while (topBeg != topEnd)
   {
    topTmp.insert_(*topBeg);//Number not large enough add another digit
   if (topTmp &gt;= bottom)
   {//ok number &gt;= we can divide 
       LINT_rep topShelf = topTmp / bottom;//HERE I'M RUNNING INTO TROUBLE
   }
   else
   {
  
  
   }
   ++topBeg;
   }
   return LINT_rep("-1");//DUMMY
  }
  </code></pre>
  
  <p>What I'm trying to do is to implement this as if I would divide those numbers by hand, so for example having for a dividend 1589 and for divisor 27 I would go like so:</p>
  
  <ol>
  <li>check if first digit is >= divisor and if so divide</li>
  <li>if not add to the first digit another digit and check if a > b</li>
  </ol>
  
  <p>At some point it will be bigger (in simplified scenario) and if so I have to divide but in this case I'm running into recursive call and I have no idea how to break it.<br>
  One note: as a tmp I have to use LINT instead of int for example because those numbers my not fit into int.<br>
  So generally what I'm asking for is there any other way to do division? Or maybe there is false logic in my thinking (quite possible).
  Thank you.</p>