Home

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.

standard
rounding
modes
available
for
reducing
precision
or
converting
real
numbers
to
a
lower-precision
form.
It
is
sometimes
labeled
as
CEILING
or
RTP
(round
toward
positive
infinity)
in
various
libraries.
Many
programming
languages
implement
it
via
a
ceiling
function
(for
example,
ceil
in
C,
C++,
and
Python)
or
through
a
specific
rounding
mode
in
decimal
or
floating-point
APIs.
with
respect
to
the
input.
or
thresholding
tasks.
However,
it
introduces
a
positive
bias
in
aggregation
and
may
be
inappropriate
for
statistics
that
assume
symmetric
rounding.
In
numerical
libraries,
it
is
important
to
distinguish
this
mode
from
rounding
toward
zero,
toward
negative
infinity,
or
toward
the
nearest
value.