float f1 = 123.125;
int i1 = -150;
f1 = i1; // integer to floating conversion
printf("%i assigned to an float produces %f\n", i1, f1);
输出:整数到浮动转换用C
-150 assigned to an float produces -150.000000
我的问题是为什么结果具有.
而不是7或8或一些数量的后6个零(000000
)?
为什么它附加了6个零。不是7或8个零。基于我的硬件的零的数量? – 2011-01-30 03:32:25