## | Residue

Two-argument form See also one-argument form Absolute value

For positive arguments, gives the remainder resulting from dividing the right- hand argument by the left-hand argument. When the arguments are of the opposite sign, the result is the complement of the result that you would get if they had the same sign. So for non-zero results, you must subtract the remainder from the divisor. (This operation is affected by ŒCT, the comparison tolerance)

                 3 | 10                  (The remainder of 10÷3)
           1
                 7 | 24 5 0 25           (The remainder of dividing each
              3 5 0 4                     number in a vector by 7)
                3 17 2 | 5 20 3          (The remainder after dividing each
           2 3 1                          number in a vector by the corresponding
                                          number in another similar vector)
               ¯7 | ¼ 10
          ¯6 ¯5 ¯4 ¯3 ¯2 ¯1 0 ¯6 ¯5 ¯4
                TABLE „ 2 3 ½ ¼ 6        (The remainder of dividing each
               4 | TABLE                  number in a matrix by 4)
           1 2 3
           0 1 2
                TABLE | TABLE            (The remainder after dividing each
           0 0 0                          number in a matrix by the
           0 0 0                          corresponding number in another)
                 2 |1 (2 2 ½¼4) (¼3)     (Divide every element by 2)
            1    1 0   1 0 1
                 1 0
                 2  3|2 (2 2 ½¼4) (¼3)   (Arguments must be of equal length)
           LENGTH ERROR
                 2 3|2(2 2½¼4)(¼3)
                 ^
                 (2 2½¼4) 3 (¼3)|3 (2 2 ½¼4) (3 2 1)
             0 1    1 2   0 0 1          (Corresponding elements divided)
             0 3    0 1

Topic: APLX Help : Help on APL language : APL Primitives : | Residue

[ Previous | Next | Contents | Index ]