AFAIK .NET的默认圆形选项是偶数,所以Math.Round(1.225,2)应该给1.22,但它给出1.23.
Math.Round(1.225,2)
Math.Round(2.225,2) = 2.22 Math.Round(100.225,2) = 100.22
我试过的所有值都是最接近的,但只有1.225和-1.225回合到1.23和-1.23.
.net c# bankers-rounding rounding
.net ×1
bankers-rounding ×1
c# ×1
rounding ×1