CPolynomial:Init CPolynomial:Remove

CPolynomial:MaxOrder


The MaxOrder method returns the order of the maximum order coefficient that has been initialized.

Syntax

order = CPolynomial:MaxOrder()

    On success, this method returns order as an integer number.

    On failure, this method returns 0.

Example

Suppose that the CPolynomial P contains 3 coefficients with the highest order being 5. This script fragment returns the maximum order defined:

 

P = CPolynomial:new()

-- create a CPolynomial

P:Set( 0, 5.5)

-- set coef[0]

P:Set( 1, 0.144)

-- set coef[1]

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

-- set coef[5]

nMax = P:MaxOrder()

-- get the maximum defined order

Printf("MaxOrder = %d", nMax)

-- result: MaxOrder = 5

Related Topics

CPolynomial, Exists