whattype - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


whattype

query the basic data type of an expression

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

whattype(expr)

whattype[kernel](expr)

Parameters

expr

-

any expression

Description

• 

The whattype(expr) function returns the data type name of expr, which may be any of the following basic data types:

`*`

`+`

`..`

`::`

`<`

`<=`

`<>`

`=`

`^`

`||`

`and`

Array

array

assignment

complex(extended_numeric)

`do`

exprseq

extended_numeric

float

foreign

fraction

function

hfarray

`if`

`implies`

indexed

integer

list

Matrix

`module`

moduledefinition

`not`

object

`or`

package

procedure

python

record

SDMPoly

series

set

string

symbol

table

uneval

unknown

Vector[column]

Vector[row]

`xor`

zppoly

 

• 

Although exprseq is not a type name known to the type function, it is the name of the internal data structure for expression sequences.

• 

For a general expression, whattype returns the "top level" data type as determined by the order of precedence of the operators.

• 

If the expression is an object whose type name occurs either the object itself, or specifically to whattype, the object type's name is returned. If the object's type is not known, whattype returns object as the type.

• 

The whattype function produces slightly different output if invoked as whattype[kernel](expr):

– 

If expr is a software or hardware floating point, whattype returns float or hfloat respectively, instead of returning float for both cases.

– 

If expr is an object, whattype returns object for any object, even if it has a known name.

Examples

whattypex+y

`+`

(1)

whattypexy

`+`

(2)

whattypex

`*`

(3)

whattypex2fy

`*`

(4)

whattypexy

`*`

(5)

whattypexy

`^`

(6)

whattype1x

`^`

(7)

whattypex&comma;y

exprseq

(8)

whattypex&comma;y&comma;z

list

(9)

whattype2+4I

complexextended_numeric

(10)

whattypea

symbol

(11)

a1&colon;

whattypea

integer

(12)

bhello&colon;

whattypeb

string

(13)

Mrtable1&comma;2&comma;3&comma;4

M1234

(14)

whattypeM

Array

(15)

NMatrix1&comma;2&comma;3&comma;4

N1234

(16)

whattypeN

Matrix

(17)

qDEQueue5&comma;6&comma;7

qDEQueue5&comma;6&comma;7

(18)

whattypeq

DEQueue

(19)

whattypekernelq

object

(20)

See Also

exprseq

NumericClass

operators[precedence]

type