A historical note:  In *A Programming
Language*<http://www.jsoftware.com/papers/APL.htm>(1962) residue was
defined with an arbitrary integer origin j.  See Section
1.4, subsection Residues and Congruence, and Summary of Notation, S.4,
Elementary Operations.

For each set of integers *n*, *j*, and *b*, with *b* > 0, there exists a
unique pair of integers *q* and *r* such that

      *n* = *b**q* + *r*,   *j* ≤ *r* < *j* + *b*.
The quantity *r* is called the *j-residue of n modulo b* and is denoted by *
b* |* j* *n*.

The removal of index origin from residue (and other functions) was
discussed in Section H of *APL Syntax and Semantics* (1983):

A number of people (among whom Professor Penfield is perhaps the most
persuasive) have long maintained that any benefits provided by the choice
of index origin in APL are outweighed by the burden of controlling its
effects. It is, of course, futile to propose that the present use of index
origin be changed in any way; however, in the design of any new functions
and operators one may choose to exclude dependence upon index origin, just
as the choice was made in the design of APL\360 [8] to exclude dependence
on index origin in the definition of the residue function, even though the
earlier definition in [9] included it.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to