问题描述:
VC中float和double 型的数字位数是怎么规定弄呢?有效数字是6或7位?为什么总是在小数点后有6位呢?
比如在vc中
#include
main()
{
float x;
x=12345678.0;
printf("x=%f\n",x);
}还有#include
main()
{
float x;
x=123456789.0;
printf("x=%f\n",x);
}
输出的结果有差异,第二歌词程序貌似就是随机数了.求大虾指教
比如在vc中
#include
main()
{
float x;
x=12345678.0;
printf("x=%f\n",x);
}还有#include
main()
{
float x;
x=123456789.0;
printf("x=%f\n",x);
}
输出的结果有差异,第二歌词程序貌似就是随机数了.求大虾指教
问题解答:
我来补答展开全文阅读