CPolynomial:Get
The Get method returns the coefficient value at a specified index, beginning at index 0.
value = CPolynomial:Get( n ) |
n is the index of the coefficient to retrieve.
value is the numeric value of the coefficient.
On success, the coefficient value is returned.
On failure, 0 is returned.
If the value n is not a valid index, for example, n < 0, this method returns 0.
Suppose a CPolynomial assigned to P contains 4 coefficients. This following script fragment returns the value of coefficient 1:
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("v = %lg", P:Get(1)) |
-- result: v = 0.144 |