主题:System.Math.Roud 的用法疑惑
测试代码:vs2005
{
double a = 3.9999999999;
double b = 4.149;
double c = 5;
a = System.Math.Round(a, 2);
b=System.Math.Round(b,2);
c=System.Math.Round(c,2);
}
结果: a=4.0
b=4.15
c=5.0
为什么不是:a=4.00
b=4.15
c=5.00
请高手指点[em14]
{
double a = 3.9999999999;
double b = 4.149;
double c = 5;
a = System.Math.Round(a, 2);
b=System.Math.Round(b,2);
c=System.Math.Round(c,2);
}
结果: a=4.0
b=4.15
c=5.0
为什么不是:a=4.00
b=4.15
c=5.00
请高手指点[em14]