title: C-like for loop with float values and bc, unexpected ";"
body: <p>I'm a bash beginner and I can't spot the error in this loops, and bash just gives me <code>syntax error: ';' unexpected</code>, not really useful...</p>
  
  <pre><code># log2(x) = ln(x) / ln(2)
  for (( j=$(echo "l($i) / l(2)" | bc -l) ;
      $(echo "scale=$SCALE; j &lt; (2*$i)" | bc) == 1 ;
      j=$(echo "scale=$SCALE; $j + 1/$step" | bc) ))
  do
          foo...
  done
  </code></pre>
  
  <p>What I want to do is something like this, using a C-like pseudo-code:</p>
  
  <pre><code>integer i
  
  for ( float j = log2(i) ; j &lt; 2*i ; j += 1/8 )
      ...
  </code></pre>
  
  <p>Maybe there are better ways to do this, I don't know. Can't find anything here or on Google... well, it's hard to find a solution searching "syntax error".</p>