Condividi tramite


BigDecimal.RoundHalfEven Field

Definition

Rounding mode to round towards the "nearest neighbor" unless both neighbors are equidistant, in which case, round towards the even neighbor.

[Android.Runtime.Register("ROUND_HALF_EVEN")]
public const Java.Math.RoundOptions RoundHalfEven = 6;
[<Android.Runtime.Register("ROUND_HALF_EVEN")>]
val mutable RoundHalfEven : Java.Math.RoundOptions

Field Value

Value = 6
Attributes

Remarks

Rounding mode to round towards the "nearest neighbor" unless both neighbors are equidistant, in which case, round towards the even neighbor. Behaves as for ROUND_HALF_UP if the digit to the left of the discarded fraction is odd; behaves as for ROUND_HALF_DOWN if it's even. Note that this is the rounding mode that minimizes cumulative error when applied repeatedly over a sequence of calculations.

This member is deprecated. Use RoundingMode#HALF_EVEN instead.

Java documentation for java.math.BigDecimal.ROUND_HALF_EVEN.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also