CPolynomial:Copy CPolynomial:Empty

CPolynomial:Count


The Count method returns the number of coefficients in the CPolynomial object. This is not the related to the order of the highest coefficient. For example, if the CPolynomial contains only 1 coefficient of order 10, then Count = 1.

Syntax

number = CPolynomial:Count()

    On success, this method returns the number of coefficients.

    On failure, this method returns 0.

Example

Suppose a CPolynomial assigned to P contains 4 coefficients with the highest order set being 5:

 

P = CPolynomial:new()

-- create a CPolynomial

P:Set( 0, 5.5)

-- set coef[0]

P:Set( 1, 0.144)

-- set coef[1]

P:Set( 6, -0.15221e-12)

-- set coef[6]

Printf("Count = %d", P:Count())

-- result: Count = 3

Related Topics

CPolynomial, Exists