title: Replacing constant with variable of the same value and type, causes different results
body: <pre><code>int main()
  {
      int nodes = 7;
  
      int var_1 = (int)(log((double)(nodes + 1))/log(2) - 1);
      int var_2 = (int)(log((double)(7 + 1))/log(2) - 1);
  
      printf("%d\n", var_1);
      printf("%d\n", var_2);
  
      return 0;
  }
  </code></pre>
  
  <p>The above code initializes the varialbes <code>var_1</code> and <code>var_2</code> to values 1 and 2, accordingly. </p>
  
  <p>Why they have different values since the variable <code>nodes</code> has the value of 7, same as the constant in the next equation.</p>
  
  <p>Edit: I dont try to "fix" the code, or else I could just assign <code>nodes+1</code> to a variable.</p>