[ create a new paste ] login | about

Link: http://codepad.org/hcwPbKPf    [ raw code | output | fork ]

C++, pasted on Apr 22:
1
2
3
4
5
int main()
{
    printf("Double:\n33.8025-33=%g\n33.8125-33=%g\n33.8225-33=%g\n33.8325-33=%g\n33.8425-33=%g\n33.8525-33=%g\n", 33.8025-33, 33.8125-33, 33.8225-33, 33.8325-33, 33.8425-33, 33.8525-33);
    printf("\nSingle:\n33.8025-33=%f\n33.8125-33=%f\n33.8225-33=%f\n33.8325-33=%f\n33.8425-33=%f\n33.8525-33=%f\n", 33.8025f-33.0f, 33.8125f-33.0f, 33.8225f-33.0f, 33.8325f-33.0f, 33.8425f-33.0f, 33.8525f-33.0f);
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Double:
33.8025-33=0.8025
33.8125-33=0.8125
33.8225-33=0.8225
33.8325-33=0.8325
33.8425-33=0.8425
33.8525-33=0.8525

Single:
33.8025-33=0.802502
33.8125-33=0.812500
33.8225-33=0.822498
33.8325-33=0.832500
33.8425-33=0.842499
33.8525-33=0.852501


Create a new paste based on this one


Comments: