Top
Back: 4.12.1 poly declarations
Forward: 4.12.3 poly operations
FastBack: 4. Data types
FastForward: 5. Functions and system variables
Up: 4.12 poly
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

4.12.2 poly expressions

A poly expression is (optional parts in square brackets):

  1. a monomial (there are NO spaces allowed inside a monomial)
     
      [coefficient] ring_variable [ exponent] [ring_variable [exponent] …]
    

    monomials which contain an indexed ring variable must be built from ring_variable and coefficient with the operations * and ^

  2. an identifier of type poly
  3. a function returning poly
  4. poly expressions combined by the arithmetic operations +, -, *, /, or ^
  5. an int expression (see Type conversion and casting)
  6. a type cast to poly

Example:

 
2x, x3, 2x2y3, xyz, 2xy2; //  are monomials
2*x, x^3, 2*x^2*y^3, x*y*z, 2*x*y^2; // are poly expressions
2*x(1); // is a valid poly expression, but not 2x(1) (a syntax error)
2*x^3;  // is a valid poly expression equal to 2x3 (a valid monomial)
        // but not equal to 2x^3 which will be interpreted as (2x)^3
        // since 2x is a monomial
  ring r=0,(x,y),dp;
  poly f = 10x2y3 +2x2y2-2xy+y -x+2;
  lead(f);
→ 10x2y3
  leadmonom(f);
→ x2y3
  simplify(f,1);     // normalize leading coefficient
→ x2y3+1/5x2y2-1/5xy-1/10x+1/10y+1/5
  poly g = 1/2x2 + 1/3y;
  cleardenom(g);
→ 3x2+2y
  int i = 102;
  poly(i);
→ 102
  typeof(_);
→ poly

See Type conversion and casting; ring.


Top Back: 4.12.1 poly declarations Forward: 4.12.3 poly operations FastBack: 4. Data types FastForward: 5. Functions and system variables Up: 4.12 poly Top: Singular 2-0-4 Manual Contents: Table of Contents Index: F. Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.