由买买提看人间百态

topics

全部话题 - 话题: mary015
(共0页)
w****n
发帖数: 31
1
来自主题: Computation版 - 有个问题drive me crazy
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
来自主题: Computation版 - 老大们再帮一把吧
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
来自主题: Computation版 - 老大们再帮一把吧
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
来自主题: Computation版 - 有个问题drive me crazy
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
(共0页)