title: Conversion between binary and decimal
body: <p>How do I convert between decimal and binary? I'm working on a Solaris 10 platform</p>
  <blockquote>
  <p>Decimal to Binary<br />
  4000000002 -&gt; 100000000000000000000000000010</p>
  <p>Binary to Decimal<br />
  100000000000000000000000000010 -&gt; 4000000002</p>
  </blockquote>
  <p>I used the following command in unix but it takes lot of time. I have 20 million records like this</p>
  <p>For decimal to binary, set obase to 2:</p>
  <pre><code>echo 'obase=2;4000000002' | bc 
  </code></pre>
  <p>For binary to decimal, set ibase to 2:</p>
  <pre><code>echo 'ibase=2;100000000000000000000000000010' | bc 
  </code></pre>