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




Twoargument form See also oneargument form Absolute value For positive arguments, gives the remainder resulting from dividing the right hand argument by the lefthand 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 nonzero results, you must subtract the remainder from the divisor. (This operation is affected by 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 32 (2 2 ⍴⍳4) (⍳3) (Arguments must be of equal length) LENGTH ERROR 2 32(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 

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

Copyright © 19962010 MicroAPL Ltd