type/range - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

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

type/range

check for a range

 Calling Sequence type(expr, 'range') type(expr, 'range'(typespec)) type(expr, '..') type(expr, '..'(typespec))

Parameters

 expr - any expression typespec - any type expression

Description

 • This function returns true if expr is of type range, and false otherwise.
 • An expression of type range (also called type ..) has two operands, the expression on the left-hand side and the expression on the right-hand side. These two operands are separated by an ellipsis (..) .
 • The optional parameter typespec may be used to specify a type that the operands of expr must also satisfy. The typespec parameter may be used with either form (range or ..) of the type.

Examples

 > $\mathrm{type}\left(a..b,'\mathrm{..}'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(1..4,'\mathrm{..}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(i..j,'\mathrm{range}'\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(1..n,'\mathrm{range}'\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{type}\left(1..n,'\mathrm{range}'\left(\mathrm{posint}\right)\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{type}\left(1..10,'\mathrm{range}'\left(\mathrm{posint}\right)\right)$
 ${\mathrm{true}}$ (6)

 See Also