title: How to multiply an int with a fraction
body: <p>I need to multiply an int by a fraction using bitwise operators without loops and such. </p>
  
  <p>For example, I need to multiply by x by 3/8. </p>
  
  <p>I thought you would:</p>
  
  <pre><code>int value = (x &lt;&lt; 1) + x;  // Multiply by 3
  value = (value &gt;&gt; 3);          // Divide by 8
  </code></pre>
  
  <p>But that doesnt work. I tried googling binary times fraction but that give floating point examples. I dont know exactly if this homework is for floating point but my hunch is no but getting me prepared for it. So any suggestions?</p>
  
  <hr>
  
  <p>I need to round toward zero so any suggestions? This doesnt work for the number -268435457.</p>