1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
|
#include <stdio.h>
int main(int argc, const char * argv[]) {
float Zahla=1.0F;
float Zahlb;
while (1+Zahla > 1) {
Zahlb=Zahla;
Zahla /= 2; // Zahla=1.0;
}
printf("float: %g\n",Zahlb);
double epsilon = 0.01;
double epsilonValid;
while ((1 + epsilon) > 1)
{
epsilonValid = epsilon;
epsilon /= 2;
}
printf("double: %g\n", epsilonValid);
long double c=0.0234L;
long double d;
while ((1+c)>1) {
d=c;
c/=2;
}
printf("long double: %.30Lf\n",d);
return 0;
} |