# The Euclidean definition of the functions div and mod

@article{Boute1992TheED, title={The Euclidean definition of the functions div and mod}, author={R. Boute}, journal={ACM Trans. Program. Lang. Syst.}, year={1992}, volume={14}, pages={127-144} }

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 (which is shown to be an unfortunate choice) 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… Expand

#### 45 Citations

Division and Modulus for Computer Scientists

- Computer Science
- 2001

An algorithm for the Euclidean div and mod functions is given and it is proved it correct with respect to Euclid’s theorem. Expand

Modulo intervals: a proposed notation

- Mathematics, Computer Science
- SIGA
- 2012

Definition (1) works perfectly well when the interval is given backward, that is, a > b, yielding a modulus in the right-closed interval (b . . a). Expand

Zeroless Positional Number Representation and String Ordering

- Mathematics, Computer Science
- Am. Math. Mon.
- 2000

A simple system (henceforth called BS) is described that does not need zero and has the interesting property that the representation is unique, unlike the generally accepted system (AS) where leading zeros can be added without changing the value. Expand

How to calculate proofs: bridging the cultural divide

- Mathematics
- 2013

T his article argues that one of the most neglected opportunities in many branches of mathematics is symbolic reasoning for the “logical” parts rather than just for the algebraic, analytic, etc.,… Expand

Functional declarative language design and predicate calculus: a practical approach

- Computer Science
- TOPL
- 2005

The proposed alternative combines a language of utmost simplicity (four constructs only) that is devoid of the defects of common mathematical conventions, with a set of convenient calculation rules that is sufficiently comprehensive to make it practical for everyday use in most (if not all) domains of interest. Expand

Continuum versus Discrete: A Physically Interpretable General Rule for Cellular Automata by Means of Modular Arithmetic

- Computer Science, Mathematics
- Complex Syst.
- 2013

A general rule which describes every of Wolfram's cellular automata is derived and a new representation is given in terms of a new function hereby defined, the iota-delta function, which provides a straightforward physical interpretation of CA, which gives a quantitative interpretation of the generating rule itself. Expand

Pointfree expression and calculation: from quantification to temporal logic

- Computer Science
- Formal Methods Syst. Des.
- 2010

Various ramifications, style and abstraction issues are discussed, in relation to engineering mathematics in general and to categorical formulations. Expand

On the Definition of Integer Division and Modulus in Programming Languages

- Mathematics
- 2006

Problems with the definitions of integer division, modulus, and related operations in programming languages are discussed. It is demonstrated that unifying, generic definitions can be employed to… Expand

Floating-Point Formats and Environment

- Computer Science
- 2010

This chapter is a revision and merge of the earlier IEEE 754-1985 [12] and IEEE 854-1987 [13] standards and focuses on the floating-point arithmetic standard. Expand

Towards Infinite-State Symbolic Model Checking for B and Event-B

- Computer Science
- 2017

This thesis is concerned with improving the ProB model checker by augmenting its original explicit state modelChecker with a symbolic counterpart, and implements methods to increase the performance of ProB’s constraint solving kernel. Expand

#### References

SHOWING 1-10 OF 37 REFERENCES

Revised report on the algorithmic languageAlgol 60

- Mathematics
- 1962

SummaryThe report gives a complete defining description of the international algorithmic languageAlgol 60. This is a language suitable for expressing a large class of numerical processes in a form… Expand

Syntactic and semantic aspects of formal system description

- Computer Science
- 1989

Based on “standard” notations from applied mathematics, a unifying (but not yet fully formalized) set of language concepts is proposed called Funmath, intended to have, respectively, an operational interpretation as a functional programming language and a structuralinterpretation as a system description language. Expand

Fuzzy residue

- APL '79
- 1979

Certain pairs of arguments to the residue function, as implemented on many APL systems, give results which make it seem as if the ordinary decimal relationships we remember from grade school no… Expand

Arithmetic shifting considered harmful

- Computer Science
- SIGP
- 1977

A large number of sources are quoted to prove the widest extent of the confusion over the semantics of the standard "arithmetic right shift" instruction. Expand

Representational and Denotational Semantics of Digital Systems

- Computer Science
- IEEE Trans. Computers
- 1989

The input/output transformation effected by digital systems can be considered as concrete realizations of abstract mathematical functions, which constitute the necessary 'handles' (embodied by function definitions) for transformational reasoning about digital systems. Expand

Multiplexed buses: the endian wars continue

- Computer Science
- IEEE Micro
- 1990

The issue of data exchange between type-1 and type-2 buses, which multiplex the first data byte with the least and most significant portions of the address, respectively, is considered and it is concluded that big- and little-endians can use the same bus standard. Expand

fundamental algorithms

- Computer Science
- 1969

General Instructions Material: You may only use one handwritten sheet of paper (size A4, on both pages) to solve the exercises and any other material including electronic devices of any kind is forbidden. Expand

Reference Manual for the ADA® Programming Language

- Computer Science
- Springer New York
- 1983

This grammar of the Ada follows the Ada 95 Reference Manual, consisting of the international standard (ISO/IEC 8652:2012): Information Technology -Programming Languages -Ada. Expand

On The Equivalence of Time-Division and Frequency-Division Multiplexing

- Computer Science
- IEEE Trans. Commun.
- 1985

It is shown that, for a system of n band- limited signals, FDM and band-limited TDM are equivalent in the sense that one can be derived from the other by a simple linear transformation. Expand

The Art of Computer Programming

- Computer Science
- 1968

The arrangement of this invention provides a strong vibration free hold-down mechanism while avoiding a large pressure drop to the flow of coolant fluid. Expand