type/piecewise - Maple Programming Help

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

type/piecewise

determine whether the given expression is a piecewise function

 Calling Sequence type/piecewise(expr, x);

Parameters

 expr - any expression x - (optional) main variable

Description

 • The call type(expr, piecewise) returns true if expr is a piecewise function.
 • The call type(expr, piecewise(x)) checks, in addition, that the argument that x appears at least in one of the piecewise conditions involved in expr.

Examples

 > $\mathrm{type}\left({\mathrm{piecewise}}_{[]}\left(x<1,a,b\right),'\mathrm{piecewise}'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(\mathrm{piecewise}\left(x<1,a,b\right),'\mathrm{piecewise}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(\mathrm{piecewise}\left(x<1,a,b\right),'\mathrm{piecewise}'\left(x\right)\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(\mathrm{piecewise}\left(x<1,a,b\right),'\mathrm{piecewise}'\left(a\right)\right)$
 ${\mathrm{false}}$ (4)