CoCoA:MapDown

From ApCoCoAWiki

MapDown

convert a constant polynomial to a number

Description

This function converts a constant polynomial to the equivalent

coefficient. If the argument is not a constant polynomial, an error

is signalled.

Example

  Use Q[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(<quotes>Cannot MapDown non-const poly</quotes>)
-------------------------------

Syntax

MapDown(F:POLY):RAT or ZMOD
   <type>polynomial</type>