title: How to compare numbers in any base
body: <p>I have been trying to compare two numbers of any base <code>B</code> without first changing them into decimal. Is there a way to do it?</p>
  
  <p>I was able to do it by converting them into decimal. This is how i did it (on base 17):</p>
  
  <pre><code> for(i=strlen(s)-1;i&gt;=0;i--)
   {
       if(s[i]&gt;='A'&amp;&amp;s[i]&lt;='G')
           s[i]=s[i]-'A'+ 10;
       else
           s[i]=s[i]-'0';
  
       int z=(int)s[i];
  
       a+=z*pow(17,j);
       j++;
   }
  </code></pre>