fork download
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char **argv)
  4. {
  5. long double f1 = 0.1L;
  6. long double f2 = 0.2L;
  7. long double f3 = 0.3L;
  8. long double f4 = f1 + f2;
  9. long double f5 = 0.1L + 0.2L;
  10. long double f6 = 0.3L;
  11. printf("%.30Lf\n", f1);
  12. printf("%.30Lf\n", f2);
  13. printf("%.30Lf\n", f3);
  14. printf("%.30Lf\n", f4);
  15. printf("%d\n", f3 == f4);
  16. printf("%.30Lf\n", f5);
  17. printf("%d\n", f3 == f5);
  18. printf("%.30Lf\n", f6);
  19. printf("%d\n", f3 == f6);
  20. return 0;
  21. }
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
0.100000000000000000001355252716
0.200000000000000000002710505431
0.300000000000000000010842021725
0.300000000000000000010842021725
1
0.300000000000000000010842021725
1
0.300000000000000000010842021725
1