type/atomic - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

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

type/atomic

check for an object of type atomic

 Calling Sequence type(x, atomic)

Parameters

 x - any expression

Description

 • The call type(x, atomic) checks to see if x is of type atomic. It returns true if x is of type atomic, and false otherwise.
 • An object is of type atomic if it cannot be mapped over, that is, $\mathrm{map}\left(f,x\right)=f\left(x\right)$.  Objects in Maple which have this property are of type name, complex(extended_numeric), indexed, string, procedure, or module.

Examples

 > $\mathrm{type}\left(1,'\mathrm{atomic}'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(\frac{1}{2},'\mathrm{atomic}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(0.5,'\mathrm{atomic}'\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(3+\frac{1I}{2},'\mathrm{atomic}'\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{type}\left(x+\frac{1I}{2},'\mathrm{atomic}'\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{type}\left("String",'\mathrm{atomic}'\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{type}\left(\mathrm{Name},'\mathrm{atomic}'\right)$
 ${\mathrm{true}}$ (7)
 > $\mathrm{type}\left({a}_{b},'\mathrm{atomic}'\right)$
 ${\mathrm{true}}$ (8)
 > $\mathrm{type}\left(\frac{a}{b},'\mathrm{atomic}'\right)$
 ${\mathrm{false}}$ (9)

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam