Advertisement
Guest User

Untitled

a guest
Mar 4th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. int Separation_Number_Fract(double n)
  2. {
  3. int count = 0, fractpart_int;
  4. double val=0, fractpart_double, intpart_double;
  5. fractpart_double = modf(val, &intpart_double);
  6. while (n != floor(n))
  7. {
  8. n *= 10;
  9. count++;
  10. }
  11. fractpart_double = fractpart_double*pow(10, count);
  12. fractpart_int = static_cast< int >(fractpart_double);
  13. return fractpart_int;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement