int main() { printf("%f\n", (float)1/2); return 0; }
$ ./a.out 0.500000
说明是先(float)1 然后在除 2;
类型转换
原文:https://www.cnblogs.com/rivsidn/p/9240450.html