This question already has answers here:
Best Answer-推荐答案 strong>
printf("%f",9/5);
This statement is undefined behavior because the argument has to be of type double
and 9 / 5
is of type int
.
Use 9 / 5.0
to have an argument of type double
(and the correct floating division).
欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) |
Powered by Discuz! X3.4 |