2011年7月4日
摘要: Math.Round默认采用的不是四舍五入法, 而是四舍六入的银行家算法, 也就是四舍六入五考虑,五后非零就进一,五后皆零看奇偶,五前为偶应舍 去,五前为奇要进一, 这个算法比四舍五入更精确些. Response.Write("<BR>" + Math.Round(144.34, 1)); --144.3 Response.Write("<BR>" + Math.Round(144.15, 1));--144.2 Response.Write("<BR>" + Math.Round(144.25, 阅读全文
posted @ 2011-07-04 17:42 BobLiu 阅读(2479) 评论(0) 推荐(0)