Home

roundhalftoeven

Round half to even is a method of rounding numeric values to the nearest representable value. When a number is exactly halfway between two candidates, it is rounded to the candidate whose least-significant rounded digit is even. For non-half cases, standard rounding to the nearest value applies, such that values with a fractional part greater than 0.5 round up and those less than 0.5 round down.

Examples illustrate the rule. 2.5 rounds to 2, and 3.5 rounds to 4. Rounding to one decimal

This approach reduces systematic bias that can accumulate when rounding occurs repeatedly. It is used in floating-point

Implementation and usage vary by language and framework. The half-to-even rule is commonly available under labels

Cautions include the fact that binary floating-point representations can introduce small errors around halfway cases, so

place,
1.25
becomes
1.2,
while
1.35
becomes
1.4.
The
essence
is
that
halfway
cases
are
split
toward
the
even
result,
balancing
rounding
directions
over
many
calculations.
arithmetic
and
is
the
round-to-nearest,
ties-to-even
rule
specified
in
the
IEEE
754
standard
for
floating-point
computations.
Because
of
its
bias-reducing
property,
it
is
sometimes
called
banker's
rounding.
such
as
“round
to
even”
or
“banker’s
rounding.”
In
many
numerical
libraries
and
in
languages
that
comply
with
IEEE
754,
it
can
be
selected
as
the
default
rounding
mode
or
used
explicitly
for
rounding
operations.
for
exact
decimal
arithmetic
it
is
often
better
to
use
decimal
types
or
integer
scaling.
Rounding
rules
should
be
chosen
with
awareness
of
downstream
effects
on
sums,
statistics,
and
financial
calculations.