Rupert

::Me(C#,VC,MonoTouch,MonoforAndroid);

导航

2012年11月24日

摘要: C# 中没有四舍五入函数,程序语言都没有四舍五入函数,因为四舍五入算法不科学,国际通行的是 Banker 舍入法Bankers rounding(银行家舍入)算法,即四舍六入五取偶。事实上这也是 IEEE 规定的舍入标准。因此所有符合 IEEE 标准的语言都应该是采用这一算法的Math.Round 方法默认的也是 Banker 舍入法在 .NET 2.0 中 Math.Round 方法有几个重载方法Math.Round(Decimal, MidpointRounding)Math.Round(Double, MidpointRounding)Math.Round(Decimal, Int32, 阅读全文

posted @ 2012-11-24 01:47 ArRan 阅读(935) 评论(0) 推荐(0) 编辑