The Euclidean definition of the functions div and mod

@article{Boute1992TheED,
  title={The Euclidean definition of the functions div and mod},
  author={Raymond T. Boute},
  journal={ACM Trans. Program. Lang. Syst.},
  year={1992},
  volume={14},
  pages={127-144}
}
  • R. Boute
  • Published 1 April 1992
  • Computer Science
  • ACM Trans. Program. Lang. Syst.
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… 

Figures and Tables from this paper

Division and Modulus for Computer Scientists

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

Modulo intervals: a proposed notation

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).

Zeroless Positional Number Representation and String Ordering

  • R. Boute
  • 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.

How to calculate proofs: bridging the cultural divide

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.,

Functional declarative language design and predicate calculus: a practical approach

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.

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

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.

Pointfree expression and calculation: from quantification to temporal logic

  • R. Boute
  • 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.

On the Definition of Integer Division and Modulus in Programming Languages

It is demonstrated that unifying, generic definitions can be employed to provide more clarity, consistency, and coherence in this area.

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

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.

Division by invariant integers using multiplication

This paper presents code sequences for division by arbitrary nonzero integer constants and run-time invariants using integer multiplication using a two's complement architecture, and treats unsigned division, signed division, and division where the result is known a priori.

References

SHOWING 1-10 OF 29 REFERENCES

Revised report on the algorithmic languageAlgol 60

A complete defining description of the international algorithmic languageAlgol 60, a language suitable for expressing a large class of numerical processes in a form sufficiently concise for direct automatic translation into the language of programmed automatic computers is given.

Syntactic and semantic aspects of formal system description

  • R. Boute
  • Computer Science
    Microprocessing and Microprogramming
  • 1989

Fuzzy residue

A definition for a fuzzed residue function is proposed which resolves the difficulties users have complained of, but certain points of continuing difficulty remain, where the limitations of machine arithmetic continue to defeat the attempt to model the real number system.

Representational and Denotational Semantics of Digital Systems

  • R. Boute
  • 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.

Multiplexed buses: the endian wars continue

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.

Revised report on the algorithmic language ALGOL 68

The report gives a complete defining description of the international algorithmic language Algol 60. This is a language suitable for expressing a large class of numerical processes in a form suitably

fundamental algorithms

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.

Reference Manual for the ADA® Programming Language

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.

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

  • R. Boute
  • Mathematics
    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.

The Art of Computer Programming

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.