For integers and nonzero
, a least absolute remainder of
modulo
is an integer
for which
for some integer , with
as small as possible. Equivalently,
is an integer nearest to
,
so
If
is a half-integer, there are two least absolute remainders with opposite signs. For
example,
,
so
is a least absolute remainder of 47 modulo 10, whereas the ordinary nonnegative remainder is 7. Repeated least absolute remainders give
a variant of the Euclidean algorithm.