Anonymous user
Display a linear combination: Difference between revisions
m
→{{header|REXX}}: elided redundant use of ABS BIF.
(→{{header|REXX}}: added the REXX language.) |
m (→{{header|REXX}}: elided redundant use of ABS BIF.) |
||
Line 204:
$= /*nullify output (liner combination).*/
do k=1 for words(y); #=word(y,k) /* ◄───── process each of the elements.*/
if #=0 then iterate;
s='+ '; if #<0 then s='- ' /*define the sign: plus(+) or minus(-)*/
n=n+1; if n==1 then s=strip(s) /*if the 1st element used, handle sign.*/
if a\==
$=$ s'e('k")" /*construct a liner combination element*/
end /*k*/
$=strip(strip($), 'L', "+") /*strip leading plus sign (1st element)*/
|