Alternatively, a remainder is also what is left after subtracting one number from another, although this is more precisely called the difference.
In some occasions, it is convenient to carry out the division so that a is as close to an integral multiple of d as possible, that is, we can write In this case, s is called the least absolute remainder.
When dividing by d, either both remainders are positive and therefore equal, or they have opposite signs.
Extending the definition of remainder for floating-point numbers, as described above, is not of theoretical importance in mathematics; however, many programming languages implement this definition (see Modulo operation).
While there are no difficulties inherent in the definitions, there are implementation issues that arise when negative numbers are involved in calculating remainders.
The rings for which such a theorem exists are called Euclidean domains, but in this generality, uniqueness of the quotient and remainder is not guaranteed.