title: sine result depends on C++ compiler used
body: <p>I use the two following C++ compilers:</p>
  
  <ul>
  <li><strong>cl.exe</strong> : Microsoft (R) C/C++ Optimizing Compiler <strong>Version 19.00.24210</strong> for x86</li>
  <li><strong>g++</strong> : g++ (Ubuntu 5.2.1-22ubuntu2) <strong>5.2.1</strong> 20151010</li>
  </ul>
  
  <p>When using the built-in sine function, I get different results. This is not critical, but sometimes results are too significants for my use. Here is an example with a 'hard-coded' value:</p>
  
  <pre><code>printf("%f\n", sin(5451939907183506432.0));
  </code></pre>
  
  <p><strong>Result with cl.exe:</strong></p>
  
  <pre><code>0.528463
  </code></pre>
  
  <p><strong>Result with g++:</strong></p>
  
  <pre><code>0.522491
  </code></pre>
  
  <p>I know that g++'s result is more accurate and that I could use an additional library to get this same result, but that's not my point here. I would really understand what happens here: <strong>why is cl.exe that wrong?</strong></p>
  
  <p>Funny thing, if I apply a modulo of (2 * pi) on the param, then I get the same result than g++...</p>
  
  <p><strong>[EDIT]</strong> Just because my example looks crazy for some of you: this is a part of a pseudorandom number generator. It is not important to know if the result of the sine is accurate or not: we just need it to give some result.</p>