test for a specified type - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Logic : Boolean : hastype

hastype - test for a specified type

Calling Sequence

hastype(expr, t)

hastype(expr, t, 'exclude_container')

Parameters

expr

-

any expression

t

-

any Maple type

exclude_container

-

option

Description

• 

The hastype(expr, t) function returns true if expr  or any of its subexpressions is of type t.

• 

A subexpression of an expression is any of the expressions returned by the op command.

• 

Using the exclude_container option causes hastype to only look at subexpressions, and not the parent container object.

Thread Safety

• 

The hastype command is thread-safe as of Maple 15.

• 

For more information on thread safety, see index/threadsafe.

Examples

f:=x12y

f:=xy

(1)

hastypef,`*`

true

(2)

hastypef,`+`

false

(3)

hastypef,namefraction

true

(4)

hastypef,radical

true

(5)

hastypef,function

false

(6)

A:=Matrix1,2,3,4

A:=1234

(7)

hastypeA,rational

true

(8)

hastypeA,Matrix

true

(9)

hastypeA,Matrix,'exclude_container'

false

(10)

hastypeA,'Notnumeric'

true

(11)

hastypeA,'Notnumeric','exclude_container'

false

(12)

hastypeF3,identicalF

false

(13)

opF3

3

(14)

See Also

has, hasfun, membertype, op, type


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