Display a linear combination: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: changed a comment.) |
|||
Line 1,203: | Line 1,203: | ||
if #=0 then iterate; a= abs(# / 1) /*if the value is zero, then ignore it.*/ |
if #=0 then iterate; a= abs(# / 1) /*if the value is zero, then ignore it.*/ |
||
s= '+ ' ; if #<0 then s= "- " /*define the sign: plus(+) or minus(-)*/ |
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, remove |
n= n + 1; if n==1 then s= strip(s) /*if the 1st element used, remove blank*/ |
||
if a\==1 then s= s || a'*' /*if multiplier is unity, then ignore #*/ |
if a\==1 then s= s || a'*' /*if multiplier is unity, then ignore #*/ |
||
$= $ s'e('k")" /*construct a liner combination element*/ |
$= $ s'e('k")" /*construct a liner combination element*/ |