新人 大家请帮助,谢谢! 请教一个小程序题
这个程序目的是测出每加仑油车行驶里程# include <stdio.h>
int main(void){
double gallons;
double miles;
double product;
printf ( " Enter the gallons used :");
scanf ( "%f", &gallons);
printf ( " Enter the miles driven :");
scanf (" %f", &miles);
product = miles / gallons;
printf ( " The miles / gallon for this tank was: %f",product);
return 0;}
结果为什么是 在输入 Enter the gallons used 12.8 Enter the miles driven : 287 后
系统提示我 Floating point error: overflow 谢谢高手!