up previous next

StarPrint

Syntax

StarPrint(F:POLY):NULL
StarPrintFold(F:POLY, LineWidth:INT)
    

Summary

print polynomial with *'s for multiplications

Description

These functions print the polynomial F with asterisks added to denote multiplications. They may be useful when cutting and pasting from CoCoA to other mathematical software. StarPrint inserts newline characters (only between terms) to avoid lines much longer than about 70 characters. If a different approximate maximum length is desired this may be specified as the second argument to StarPrintFold; a negative value means no line length limit.

example

    
Use R ::= Q[x,y];
F := x^3+2xy-y^2;
StarPrint(F);
1*x^3+2*x*y-1*y^2
-------------------------------
StarPrintFold(F,0); -- this will print one term per line
1*x^3
+2*x*y
-1*y^2
-------------------------------