title: Incorrect result printed when multiplying numbers in C
body: <p>I've recently begun using C and I'm having some problems with the simple arithmetic operation of just being able to multiply two numbers.</p>
  
  <p>Initially, I tried to print the result of 8 * 2 to a file. Currently this outputs 16. Next, I multiplied what I really wanted 8*0.000000123456789. Here is my code:</p>
  
  <pre><code>            fprintf( fp2, "%d\n", (long double)(8*0.000000123456789));
  </code></pre>
  
  <p>The result outputted to the file is : <strong>-1086490624</strong>. Whereas really it should have been : <strong>0.000000987654312</strong>. I intentionally type-casted the arithmetic as a long double to prevent any overflow. Not doing anything and using:</p>
  
  <pre><code>            fprintf( fp2, "%d\n", (8*0.000000123456789));
  </code></pre>
  
  <p>Yields <strong>1719134127</strong>, again having no relation to the actual value of <strong>0.000000987654312</strong></p>
  
  <p>Any suggestions please?</p>