[TIPS] 判断一个数为整数还是小数 | C++ 判断一个数是整数还是小数,代码如下: bool A(float a) { if(a-(int)a==0) //核心在此a-(int)a return 0; else return 1; }