type/numeric - Maple Programming Help

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

type/numeric

check for an object of type numeric

type/extended_numeric

check for an object of type extended_numeric

 Calling Sequence type(x, numeric) type(x, extended_numeric)

Parameters

 x - any expression

Description

 • The type(x, numeric) function returns true if x is an integer, fraction, or finite floating-point number.
 • The type(x, extended_numeric) function returns true if x is a numeric, infinity, -infinity, or undefined.
 Note:  Float(infinity) and Float(undefined) are of type extended_numeric, but not of type numeric.

Examples

 > $\mathrm{type}\left(1,\mathrm{numeric}\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(\frac{1}{2},\mathrm{numeric}\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(0.5,\mathrm{numeric}\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(\mathrm{Name},\mathrm{numeric}\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{type}\left(\frac{a}{b},\mathrm{numeric}\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{type}\left(\mathrm{∞},\mathrm{extended_numeric}\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{type}\left(\mathrm{Float}\left(\mathrm{undefined}\right),\mathrm{numeric}\right)$
 ${\mathrm{false}}$ (7)
 > $\mathrm{type}\left(\mathrm{Float}\left(\mathrm{undefined}\right),\mathrm{extended_numeric}\right)$
 ${\mathrm{true}}$ (8)