phipps@fortune.UUCP (Clay Phipps) (09/11/84)
Pascal doesn't define its modulus operator for negative 'divisors'. To quote from ANSI/IEEE 770X3.97-1983 (the Pascal Standard), p. 73: A term of the form i mod j shall be an error if j is zero or negative, otherwise the value of i mod j shall be that value of (i-(k*j)) for integral k such that 0 <= i mod j < j. NOTE: Only for i >= 0 and j > 0 does the relation (i div j) * j + i mod j = i hold. -- Clay Phipps -- { amd hplabs!hpda sri-unix ucbvax!amd } !fortune!phipps { ihnp4 cbosgd decvax!decwrl!amd harpo allegra}