Polynomial long division: Difference between revisions
Content deleted Content added
m →{{header|zkl}}: extrainous code |
→{{header|zkl}}: bug fix |
||
Line 1,949: | Line 1,949: | ||
.replace(" 1x"," x").replace("x^0 "," ").replace("x^1 ","x ") |
.replace(" 1x"," x").replace("x^0 "," ").replace("x^1 ","x ") |
||
.replace("+ -", "- "); |
.replace("+ -", "- "); |
||
if(str |
if(not str) return(" "); // all zeros |
||
if(str[0]=="+") str[1,*]; // leave leading space |
|||
else String("-",str[2,*]); |
else String("-",str[2,*]); |
||
}</lang> |
}</lang> |