我试图只获得数字中点后面的数字
float number;
printf("Enter a real number:\n");
scanf("%f", &number);
int integerPart = (int)number;
int fractionalPart = (int)((number -(float)integerPart) *1000);
printf("The fractional part: %d\n", fractionalPart);
当我输入256.589时,我得到588的输出 为什么呢?