span>),
  <span class="hljs-built_in">tonumber</span>(<span class="hljs-string">&apos;101&apos;</span>, <span class="hljs-number">2</span>)
))
</code></pre>
<p>Note that you need to always use <code>tonumber()</code> to convert your binary string to a number as the function always expects a decimal number.
Likewise the output will always be a decimal number:</p>
<pre><code>5
</code></pre><p>Lay it out like an arithmetic table and you can solve it just as easily:</p>
<pre><code>  111
  101
  ---
  101 --&gt;