ispoly - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Data Types : Type Checking : ispoly

ispoly

test for a polynomial of a particular degree

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

ispoly(f, kind, x)

ispoly(f, kind, x, 'a0', 'a1',..., 'an')

ispoly(f, n, x)

ispoly(f, n, x, 'a0', 'a1',..., 'an')

Parameters

f

-

any expression

kind

-

one of linear, quadratic, cubic, or quartic

x

-

name

n

-

positive integer

a0, a1, ...

-

(optional) names to be assigned the coefficients

Description

• 

The ispoly function returns true if the input expression f is a polynomial of exactly degree n in the variable x, and false otherwise.  If successful, it assigns the remaining (optional) arguments the coefficients of degree 0, 1, ..., n.

• 

Note, unlike the type function (with the linear, quadratic, cubic, or quartic option) in Maple, the ispoly function ensures that the coefficient of degree n is non-zero.

• 

The second argument may be one of the keywords linear, quadratic, cubic, or quartic which can be used instead of integers 1, 2, 3, 4, respectively.

Examples

fax+b

f:=ax+b

(1)

ispolyf,quadratic,x

false

(2)

ispolyf,linear,x,'a0','a1'

true

(3)

a0,a1

b,a

(4)

faa1x2a2x2+ax2+aa1x+ax

f:=aa1x2a2x2+ax2+aa1x+ax

(5)

ispolyf,quadratic,x,'a0','a1','a2'

false

(6)

ispolyf,linear,x,'a0','a1'

true

(7)

a0,a1

0,a2

(8)

fx62x3+3

f:=x62x3+3

(9)

ispolyf,6,x,seqevalnai,i=0..6

true

(10)

seqai,i=0..6

3,0,0,2,0,0,1

(11)

See Also

type/linear

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam