type/scalar - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Data Types : Type Checking : Types : type/scalar

type/scalar

check for scalar (in the matrix sense)

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

type(expr, scalar)

Parameters

expr

-

expression

Description

• 

Checks if expr is a scalar. This is the case if expr is algebraic and not a Vector or Matrix.

• 

More precisely, expr is a scalar if:

– 

expr is of type algebraic, and

– 

expr is not the name of a procedure, table, or module, and

– 

if the top-level type of expr is one of `*`, `+`, `.`, `^`, `&*`, `&+`, and `&^` (that is, if op(0, expr) is one of these operators), then all its arguments are scalars.

Examples

atable'apple'=3,'orange'=5

atableapple=3,orange=5

(1)

typea,scalar

false

(2)

typex,scalar

true

(3)

type42,scalar

true

(4)

typesin,scalar

false

(5)

typex.y,scalar

true

(6)

vVector1,2,3

v123

(7)

typex.v,scalar

false

(8)

See Also

type

type,algebraic