fork(3) download
  1. #include <stdio.h>
  2.  
  3. double aFunction(int a, unsigned int b)
  4. {
  5. unsigned int b1 = b%10;
  6. unsigned int b2 = b/10;
  7. double dec = 0.0;
  8. while ( b2 > 0 )
  9. {
  10. dec = (dec + b1)/10.0;
  11. b1 = b2%10;
  12. b2 = b2/10;
  13. }
  14. dec = (dec + b1)/10.0;
  15. return a + dec;
  16. }
  17.  
  18. int main()
  19. {
  20. printf("%14.10lf\n", aFunction(10, 234));
  21. printf("%14.10lf\n", aFunction(345, 933749373));
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 2008KB
stdin
Standard input is empty
stdout
 10.2340000000
345.9337493730