type/scalar
check for scalar (in the matrix sense)
Calling Sequence
Parameters
Description
Examples
type(expr, scalar)
expr
-
expression
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.
a≔table⁡apple=3,orange=5
a≔table⁡orange=5,apple=3
type⁡a,scalar
false
type⁡x,scalar
true
type⁡42,scalar
type⁡sin,scalar
type⁡x·y,scalar
v≔Vector⁡1,2,3
v≔123
type⁡x·v,scalar
See Also
type
type,algebraic
Download Help Document