Skip to content

enum Number::RoundingMode

Specifies rounding behaviour for numerical operations capable of discarding precision.

Members

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).

Methods

#ties_away?

View source

#ties_even?

View source

#to_negative?

View source

#to_positive?

View source

#to_zero?

View source