Previous Page Next Page Contents

nterms -- the number of terms of a polynomial

Introduction

nterms(p) returns the number of terms of the polynomial p.

Call(s)

nterms(p)
nterms(f <, vars>)

Parameters

p - a polynomial of type DOM_POLY
f - a polynomial expression
vars - a list of indeterminates of the polynomial: typically, identifiers or indexed identifiers

Returns

a nonnegative number. FAIL is returned if the input cannot be converted to a polynomial.

Overloadable:

p

Related Functions

coeff, degree, degreevec, ground, lcoeff, ldegree, lmonomial, lterm, nthcoeff, nthmonomial, nthterm, poly, poly2list, tcoeff

Details

Example 1

We give some self explaining examples:

>> nterms(x^2*y^2 + x^2 + y + 2, [x, y])
                                     4
>> nterms(poly(x^2*y^2 + x^2 + y + 2))
                                     4
>> nterms(poly(0, [x]))
                                     0

Example 2

The following polynomial expression may be regarded as a polynomial in different ways:

>> f := x^2*y^2 + x^2 + y + 2:
   nterms(f, [x]), nterms(f, [y]), nterms(f, [x, y]),
   nterms(f, [z])
                                2, 3, 4, 1
>> delete f:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000