不过MSDN文档中这个MidpointRounding.AwayFromZero的描述是“当一个数字是其他两个数字的中间值时,会将其舍入为两个值中绝对值较小的值。”弄的我很长时间没反应过来。 实际上从 .NET 2.0 发布以来,网上已经有很多人都指出了这个翻译错误(原文实际是 When a number is halfway between two others, it is round...
Round to nearest mode: when a number is halfway between two others, it is rounded toward the nearest number that is away from zero. 英文的意思我觉着,是距离【一个离零最远的数】最近的一个数。这个英文表达和中文翻译有点意思。
The strategy of rounding to the nearest number, and when a number is halfway between two others, it's rounded toward the nearest number that's away from zero. ToZero 2 The strategy of directed rounding toward zero, with the result closest to and no greater in magnitude than the infinitely...
MidpointRounding.AwayFromZero// A number is rounded twoards the nearest number that is away from ZeroMidpointRounding.ToEven// A number is rounded towards the nearest even numberYou can find more about MidpointRounding enum in MSDN2.I want to start answering frequent ask BCL questions on this...
On the midpointrounding documentation for 4.8.1, the enum has two values, but the Examples uses a third undocumented value of ToZero. Activity issues-automationadded Pri3Indicates issues/PRs that are low priority on Mar 28, 2024 dotnet-policy-serviceadded untriagedNew issue has not been triag...
The strategy of rounding to the nearest number, and when a number is halfway between two others, it's rounded toward the nearest number that's away from zero. ToZero 2 The strategy of directed rounding toward zero, with the result closest to and no greater in magnitude than the infinitely...
The strategy of rounding to the nearest number, and when a number is halfway between two others, it's rounded toward the nearest number that's away from zero. ToZero2 The strategy of directed rounding toward zero, with the result closest to and no greater in magnitude than the infinitely...
The strategy of rounding to the nearest number, and when a number is halfway between two others, it's rounded toward the nearest number that's away from zero. ToZero2 The strategy of directed rounding toward zero, with the result closest to and no greater in magnitude than the infinitely...
The strategy of rounding to the nearest number, and when a number is halfway between two others, it's rounded toward the nearest number that's away from zero. ToZero2 The strategy of directed rounding toward zero, with the result closest to and no greater in magnitude than the infinitely...
The strategy of rounding to the nearest number, and when a number is halfway between two others, it's rounded toward the nearest number that's away from zero. ToEven 0 The strategy of rounding to the nearest number, and when a number is halfway between two others, it's rounded toward...