title: Getting the fractional part of a double value in integer without losing precision
body: <p>i want to convert the fractional part of a double value with precision upto 4 digits into integer. but when i do it, i lose precision. Is there any way so that i can get the precise value?</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main()
  {
      double number;
      double fractional_part;
      int output;
      number = 1.1234;
      fractional_part = number-(int)number;
      fractional_part = fractional_part*10000.0;
      printf("%lf\n",fractional_part);
      output = (int)fractional_part;
      printf("%d\n",output);
      return 0;
  }
  </code></pre>
  
  <p>i am expecting output to be 1234 but it gives 1233. please suggest a way so that i can get desired output. i want the solution in C language.</p>