type/logical - Help

Home : Support : Online Help : type/logical

type

 logical

 Calling Sequence type(expr, logical)

Parameters

 expr - any expression

Description

 • These functions return true if expr is of the specified type, and false otherwise.
 • An expression is of type logical if it is of type and, or, xor, implies, or not. For each of the types f, where f is one of and, or, xor, implies, or not, x is of type f if op(0, x) = f.

Supertypes

 •

Examples

 > $\mathrm{type}\left(x<5,\mathrm{logical}\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{type}\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{or}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{not}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b,\mathrm{logical}\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(1<2\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{and}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}5
 ${\mathrm{false}}$ (3)