float f1 = 123.125;
int i1 = -150;
f1 = i1; // integer to floating conversion
printf("%i assigned to an float produces %f\n", i1, f1);
Run Code Online (Sandbox Code Playgroud)
输出:
-150 assigned to an float produces -150.000000
Run Code Online (Sandbox Code Playgroud)
我的问题是为什么结果000000后面有6个零().而不是7或8或一些数字?