A notation for the GCD and LCM functions

  • Authors:
  • E. E. McDonnell

  • Affiliations:
  • -

  • Venue:
  • APL '75 Proceedings of seventh international conference on APL
  • Year:
  • 1975

Quantified Score

Hi-index 0.03

Visualization

Abstract

This paper proposes a notation to be used for the greatest common divisor (gcd) and least common multiple (1cm) functions in APL. The notation proposed is that in use for the logical or and and functions: @@@@ for gcd and &Lgr; for lcm. For this reason, special attention is paid to the cases of gcd and lcm for the arguments 0 and 1. Also, because we wish to define the functions for negative and complex rational values as well as for positive integers, we discuss the functions more generally than is the case in standard number theory texts, which usually restrict their discussions to positive integers. For this reason we give proofs of some of the basic theorems concerning gcd and lcm, written to insure that they are valid for the entire domain of values for which it is proposed the APL functions be defined. The discussion in this paper is couched in terms of integral arguments. The theoretical extension to rational arguments is an easy one, and it is assumed that the gcd and lcm functions, which depend on the residue function for their definitions, will be implemented for non-integral arguments, just as is the residue function, with all the practical difficulties which this entails. In this paper, the terms “greatest” and “least” are taken to refer to magnitudes, and the terms “divisor” and “multiple” mean integer divisor and integer multiple.