The function
properFraction takes a real fractional number
x and returns a pair
(n,f) such that
x =
n+f, and:
- n is an integral number with the same sign as x;
and
- f is a fraction with the same type and sign as
x, and with absolute value less than 1.
The default definitions of the
ceiling,
floor,
truncate and
round functions are in terms of
properFraction.