title: How to get the first x (leftmost) digits of a decimal number
body: <p>Let's assume that I have <code>n=1234</code> and I want to get the first <code>x</code> digits of <code>n</code>. Assume <code>x=2</code>, in C math I just compute <code>1234/100</code> and I will get <code>12</code>. But how can I do it programatically? I.e., using math.
  I have implemented it by the horrible way, converting to string and putting a <code>0</code> at <code>x</code> position.
  If possible, I want to avoid built-in C functions because my goal is to convert the algorithm to assembly language later.</p>