Weby shortcut 1a5a9004da81162f034eff2fc7a06c396dfddb022021fd13958735cc25a4882f
teste

PRINTPOL

  • This function  prints a non-commutative polynomial as an input to a tex file.


PRINTPOL:=function(pol)
local polstrg, ind;

polstrg:=String(pol);

if polstrg = "0" then
    Print(polstrg);
    #return polstrg;
else
    polstrg:=SplitString(polstrg, "+");
    Sort(polstrg, ORDERING);
    polstrg:=Reversed(polstrg);
    for ind in [1..Size(polstrg)] do
        if EvalString(COEF_STRG(polstrg[ind])) < 0 or ind =1 then
            PrintNP(GP2NP(EvalString(polstrg[ind])));
        else
            Print("+");PrintNP(GP2NP(EvalString(polstrg[ind])));
        fi;
    od;
fi;
end;

Listar Todas Voltar