c语言小数运算的坑

#include
#define DROOP_V_COUNT(p) ((46800 - (p)) / 120)
int main()
{
	printf("%f\n", DROOP_V_COUNT(600));
	return 0;
}

打印为0

#include
#define DROOP_V_COUNT(p) ((46800.0 - (p)) / 120.0)
int main()
{
	printf("%f\n", DROOP_V_COUNT(600));
	return 0;
}

打印为385.0

你可能感兴趣的:(c语言,算法,开发语言)