APLX Help : Help on APL language : APL Primitives :  Subtract




Twoargument form See also oneargument form Negate Subtracts the number(s) in the righthand argument from the number(s) in the lefthand argument: 2401 (Subtracts one number from another) 239 8 4 61 0 2 (Subtracts each number in a vector from 7 4 4 the corresponding number in a vector of equal size) 22 ¯4 151 (Subtracts 1 from each number in a 21 ¯5 14 vector of numbers) TABLE ← 3 3 ⍴ ⍳ 9 100TABLE (Subtracts each number in a matrix 99 98 97 from a scalar) 96 95 94 93 92 91 TABLETABLE (Subtracts each number in a matrix 0 0 0 from the corresponding number in a 0 0 0 matrix of equal size and dimensions) 0 0 0 1  5 (2 2 ⍴⍳4) (⍳5) (Each element in the right argument is ¯4 0 ¯1 0 ¯1 ¯2 ¯3 ¯4 subtracted from 1) ¯2 ¯3 2 35 (2 2 ⍴⍳4) (⍳5) (Arguments must be the same length) LENGTH ERROR 2 35(2 2⍴⍳4)(⍳5) ^ (2 2⍴⍳4) 10 (5⍴3)5 (2 2 ⍴⍳4) (⍳5) ¯4 ¯3 9 8 2 1 0 ¯1 ¯2 (Corresponding elements subtracted) ¯2 ¯1 7 6 Note: Remember that APL uses a special symbol (the high minus 

APLX Help : Help on APL language : APL Primitives :  Subtract

Copyright © 19962010 MicroAPL Ltd