CPolynomial:Remove


The Remove method removes the coefficient at index n.

Syntax

value = CPolynomial:Remove( n )

bullet.gif    n is the coefficient order to remove.

bullet.gif    On success, the numeric value of the removed coefficient is returned.

bullet.gif    On failure, 0 is returned.

Example

The following script removes the value at index 3:

 

P = new_polynomial()

-- create a CPolynomial object

P:Set(0, 0.144)

-- set coef[0]

P:Set(3, -0.0045)

-- set coef[3]

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

-- result: N = 2

v = P:Remove(3)

-- remove coef[3]

Printf("N= %d, x=%lg", P:Count(), v)

-- result: N = 1, x=-0.0045

Related Topics

CPolynomial, Count


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