Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<cstdio>
- #include<cmath>
- int main()
- {
- double a, b;
- long double A, B;
- a = 1; b = 3;
- A = 1; B = 3;
- a /= b;
- A /= B;
- B = a; // double > long double
- int res;
- res = A==B;
- printf("Comparing d & ld: %d\n", res);
- b = A; // long double > double
- res = a==b;
- printf("Comparing d & d: %d\n", res);
- double diff = A-a;
- printf("%.50lf\n", diff);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement