title: c++ why does ((1 / 2) * 2) return 0
body: <p>first time I'v posted here but I must know what's wrong with this simple peace of code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
      double test = (1 / 2) * 2;
      cout &lt;&lt; test &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>when ever I run this the code it displays 0, should I be casting something, it happens regardless of what compiler I use and it returns even stranger results if the '1' is divided be some form of decimal.</p>