Polynomials

Usage

polynomial(coef = c(0, 1))
as.polynomial(x)
is.polynomial(x)

Arguments

p numeric vector, giving the polynomial coefficients in increasing order.

Description

Construct, coerce to and test for polynomial objects.

Details

polynomial constructs a polynomial from its coefficients, i.e., p[1:k] specifies the polynomial

p_1 + p_2 x + p_3 x^2 + ... + p_k x^{k-1}

{p[1] + p[2]* x + p[3]* x^2 + ... + p[k]* x^(k-1)}. Internally, polynomials are simply numeric coefficient vectors of class "polynomial".

as.polynomial tries to coerce its arguments to a polynomial.

is.polynomial tests whether its argument is a polynomial (in the sense that it has class "polynomial".

Examples

polynomial(1:4)
as.polynomial(c(1,0,3,0))
polynomial(c(2,rep(0,10),1))


[Package Contents]