Fractional part (source code)

= Fractional part
{title2=$\{x\}$}
{wiki}

The fractional part of a <real number> is
$$
\{x\}=x-\lfloor x\rfloor\in[0,1).
$$
It is the amount left after removing the lower enclosing <integer>, even for negative inputs. Thus $\{-2.7\}=-2.7-(-3)=0.3$. It is not the signed string of digits obtained by <truncation toward zero>.

Translation by an <integer> leaves the <fractional part> unchanged: $\{x+m\}=\{x\}$. It is therefore a <periodic function> with period one, increasing from zero toward one on each unit <interval>, then returning to zero at the next <integer>. In <Euclidean division> $N=kq+r$ with $0\leq r<k$, $\{N/k\}=r/k$; for $102/20$, this is $2/20=0.1$.

The notation is useful for following repeated motion modulo an <integer>. In <normality and equidistribution under integer multiplication>, the values $\{K^n x\}$ shift the digits of a <positional notation>; the <fractional part> discards the leading <integer> portion without losing the remaining digits. Its braces must be distinguished by context from the braces denoting a <set>.