【发布时间】:2014-09-18 22:11:25
【问题描述】:
#include <iostream>
using namespace std ;
int main ()
{
int x,y ;
x= 7 , y=3 ;
cout<<float(x) /y << endl ;
}
float(x)/y 和 x/float(y) 有什么区别?
【问题讨论】:
-
绝对没有。要么将转换为
float以进行除法。
标签: c++ floating-point division