title: bc and its ibase/obase options:
body: <p>I stumbled over a curious bug, I think: </p>
  
  <p>I tried to read "512" as a number to base 6, and output it as base 16: </p>
  
  <pre><code>echo "ibase=6;obase=16;512" | bc
  161
  </code></pre>
  
  <p>As you can see, the output is 161, but it should be <code>bc</code>(sic!). I tried with base 10: </p>
  
  <pre><code>echo "ibase=6;obase=10;512" | bc
  512
  </code></pre>
  
  <p>The value is unchanged. Curious! Default obase is 10. If I omit it:</p>
  
  <pre><code>echo "ibase=6;512" | bc
  188
  </code></pre>
  
  <p>Well, that seems right. In a two step process, it works: </p>
  
  <pre><code>echo "obase=16;"$(echo "ibase=6;512" | bc) | bc
  BC
  </code></pre>
  
  <p>So I made a script for different bases, but it keeps me puzzled:</p>
  
  <pre><code>for ib in {6,8,10,16}; do echo $ib; for ob in {10,16}; do echo -en $ib $ob"     \t =&gt; " ; echo "ibase=$ib;obase=$ob;333" | bc ; done; done; 
  6
  6 10         =&gt; 333
  6 16         =&gt; 108
  8
  8 10         =&gt; 333
  8 16         =&gt; 119
  10
  10 10        =&gt; 333
  10 16        =&gt; 14D
  16
  16 10        =&gt; 333
  16 16        =&gt;  01 15 05
  </code></pre>
  
  <p>Shall I file a bugreport, or do I miss the obvious? I can't really believe that such a basic tool is broken. </p>