enum

Number::RoundingMode

Inherits Enum / Comparable / Value / Object

Specifies rounding behaviour for numerical operations capable of discarding precision.

Constants

TIES_EVEN = 0

Rounds towards the nearest integer. If both neighboring integers are equidistant, rounds towards the even neighbor (Banker's rounding).

TIES_AWAY = 1

Rounds towards the nearest integer. If both neighboring integers are equidistant, rounds away from zero.

TO_ZERO = 2

Rounds towards zero (truncate).

TO_POSITIVE = 3

Rounds towards positive infinity (ceil).

TO_NEGATIVE = 4

Rounds towards negative infinity (floor).

Instance methods

ties_away?

Returns true if this enum value equals TIES_AWAY

Source
ties_even?

Returns true if this enum value equals TIES_EVEN

Source
to_negative?

Returns true if this enum value equals TO_NEGATIVE

Source
to_positive?

Returns true if this enum value equals TO_POSITIVE

Source
to_zero?

Returns true if this enum value equals TO_ZERO

Source