up previous next
convert a constant polynomial to a number
MapDown(F:POLY):RAT or ZMOD
|
This function converts a constant polynomial to the equivalent
coefficient. If the argument is not a constant polynomial, an error
is signalled.
Use QQ[x,y,z];
Type((x+1)^2 - x*(x+2)); -- value is seen as a polynomial
POLY
-------------------------------
MapDown((x+1)^2 - x*(x+2)); -- attempt to map down to the coeff ring
1
-------------------------------
Type(It); -- value is now simply a coefficient
RAT
-------------------------------
MapDown((x+1)^2 - x^2); -- 2*x + 1 is not a coefficient
ERROR: Cannot MapDown non-const poly
CONTEXT: Error("Cannot MapDown non-const poly")
-------------------------------
|