Home

RoundTowardZero

RoundTowardZero, often abbreviated RTZ and also described as round toward zero, is a rounding mode used in floating-point arithmetic. Under this mode, the exact mathematical result of a computation is approximated by discarding the fractional part and keeping the sign unchanged. In other words, positive values are rounded downward toward zero and negative values are rounded upward toward zero. Examples: 3.7 becomes 3, while -3.7 becomes -3. If the exact result is already an integer, it remains unchanged.

In IEEE 754, RTZ is one of the standard rounding modes used to determine the final representable

Relation to integer conversion and language semantics: RTZ is closely aligned with how many programming languages

Uses and considerations: RTZ is useful when a predictable, sign-preserving truncation is desired, such as certain

floating-point
value
after
an
operation
such
as
addition,
subtraction,
multiplication,
division,
or
square
root.
The
operation
is
performed
with
infinite
precision,
and
the
final
result
is
selected
by
rounding
toward
zero.
This
means
the
returned
value
has
a
magnitude
not
greater
than
the
exact
result
and
the
same
sign
as
the
exact
result.
There
are
no
ties
in
RTZ,
since
any
non-integer
exact
result
maps
to
a
single
truncated
value.
convert
floating-point
numbers
to
integers.
For
example,
converting
a
floating-point
value
to
an
integer
in
languages
like
C
and
Java
truncates
toward
zero.
In
other
languages,
or
in
different
contexts,
rounding
behavior
for
conversion
may
vary,
so
it
is
important
to
distinguish
explicit
RTZ
rounding
from
other
forms
of
truncation
or
rounding.
fixed-point
or
iterative
numerical
methods.
It
introduces
a
consistent,
asymmetric
rounding
error
relative
to
the
exact
result
and
can
accumulate
bias
in
some
computations,
especially
compared
with
round-to-nearest
modes.