w****n 发帖数: 31 | 1 no, it's working here:
wilson@mary015-01dhcp57:~/program/PRECISION> more long.c
#include
int main()
{
long double a;
a = 1.0/3.0;
printf("%22.20Lf\n",a);
return 0;
}
wilson@mary015-01dhcp57:~/program/PRECISION> gcc long.c
wilson@mary015-01dhcp57:~/program/PRECISION> ./a.out
0.33333333333333331483 |
|
w****n 发帖数: 31 | 2 here is the program:
#include
int main()
{
long double a;
a = 1.0/3.0;
printf("%40.40Lf\n",a);
return 0;
}
mary015-01dhcp57:/home/wilson/program/PRECISION # icc -long_double long.c
mary015-01dhcp57:/home/wilson/program/PRECISION # ./a.out
0.3333333333333333148296162562473909929395
wuwuwu, 为什么还是连20个3都得不到? |
|
w****n 发帖数: 31 | 3 re-run the code with the folloiwng modify but sitll not working.
#include
int main()
{
long double a;
a = 1.0/3.0;
printf("%40.40Lf\n",a);
printf("float=%d\n", sizeof(float));
printf("double=%d\n", sizeof(double));
printf("long double=%d\n", sizeof(long double));
return 0;
}
mary015-01dhcp57:/home/wilson/program/PRECISION # icc -long_double long.c
mary015-01dhcp57:/home/wilson/program/PRECISION # ./a.out
0.333333333333333314829616256 |
|
w****n 发帖数: 31 | 4 here it is:
wilson@mary015-01dhcp57:~/program/PRECISION> gcc -v
Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.1/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr |
|