whattype
query the basic data type of an expression
Calling Sequence
Parameters
Description
Examples
whattype(expr)
expr
-
any expression
The whattype(expr) function returns the data type name of expr, which may be any of the following basic data types:
`*`
`+`
`.`
`..`
`::`
`<`
`<=`
`<>`
`=`
`^`
`||`
`and`
Array
complex
complex(extended_numeric)
exprseq
extended_numeric
float
fraction
function
hfarray
`implies`
indexed
integer
list
module
moduledefinition
`not`
object
`or`
package
procedure
record
series
set
string
symbol
table
uneval
unknown
`xor`
zppoly
Matrix
Vector[column]
Vector[row]
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.
whattype⁡x+y
whattype⁡x−y
whattype⁡−x
whattype⁡x2⁢f⁡y
whattype⁡xy
whattype⁡1x
whattype⁡x,y
whattype⁡x,y,z
whattype⁡2+4⁢I
complex⁡extended_numeric
whattype⁡a
a≔1:
b≔hello:
whattype⁡b
M≔rtable⁡1,2,3,4
M≔1234
whattype⁡M
N≔Matrix⁡1,2,3,4
N≔1234
whattype⁡N
See Also
NumericClass
operators[precedence]
type
Download Help Document
What kind of issue would you like to report? (Optional)