CPolynomial:Remove

CPolynomial:Set


The Set method sets a coefficient index to a target value. The index begins at 0.

Syntax

CPolynomial:Set( index, value )

    index is the coefficient index to set, beginning at 0.

    value is the target value to assign to assign.

Example

The following script fragment sets 2 of the coefficient values. Other coefficients, such as Coef[3], remains undefined:

 

P = CPolynomial:new()

-- create a CPolynomial

P:Set(4, 0.112)

-- set coef[4]

P:Set(1, 5.5)

-- set coef[1]

Printf("coef[3]= %lg", P:Get(3))

-- result: coef[3] = 0

Related Topics

CPolynomial, Init