RoundTowardInfinity
RoundTowardInfinity is a rounding mode used in floating-point and decimal arithmetic that maps a real number to the nearest representable value in the direction of positive infinity. In practice, it behaves like the ceiling function: for any real x, RoundTowardInfinity(x) equals ceil(x). When applied to numbers already representable as integers, the value remains unchanged; otherwise it rounds up to the next integer or higher-precision representation.
In IEEE 754 terminology, this mode is known as round toward +infinity and is one of the
Examples include: RoundTowardInfinity(3.2) = 4, RoundTowardInfinity(-2.7) = -2, and RoundTowardInfinity(5.0) = 5. This behavior makes the operation monotone nondecreasing
Applications and considerations: RoundTowardInfinity is useful when underestimation must be avoided, such as certain display, allocation,
See also: RoundTowardZero, RoundTowardNegativeInfinity, RoundToNearest, Floor, Ceiling.