Abstract
The definitions of the functions div and mod in the computer science literature and in programming languages are either similar to the Algol of Pascal definition 1992 or based on division by truncation (T-definition) or division by flooring as defined by Knuth (F-definition). The differences between various definitions that are in common usage are discussed, and an additional one is proposed, which is based on Euclid's theorem and therefore is called the Euclidean definition (E-definition). Its distinguishing feature is that 0 ≤ D mod d < | d | irrespective of the signs of D and d. It is argued that the E- and F-definitions are superior to all other ones in regularity and useful mathematical properties and hence deserve serious consideration as the standard convention at the applications and language level. It is also shown that these definitions are the most suitable ones for describing number representation systems and the realization of arithmetic operations at the architecture and hardware level. © 1992, ACM. All rights reserved.
Author supplied keywords
Cite
CITATION STYLE
Boute, R. T. (1992). The Euclidean Definition of the Functions div and mod. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2), 127–144. https://doi.org/10.1145/128861.128862
Register to see more suggestions
Mendeley helps you to discover research relevant for your work.