两个int相除怎么得到double类型,直接转变成int了
------解决方案--------------------------------------------------------
int i = 1,j = 2;
double k=i*1.0/j;
------解决方案--------------------------------------------------------
- C# code
int i=1;int k =2;double result = (double)i/(double)kdouble result = 1d/2d;
------解决方案--------------------------------------------------------
int i=1;
int j=2
double result = Convert.ToDouble(i)/j;