CPolynomial:Copy CPolynomial:delete

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()

bullet.gif    On success, this method returns the number of coefficients.

bullet.gif    On failure, this method returns 0.

Example

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

P = new_polynomial()

-- 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


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.