type/positive - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

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

type/positive

check for a positive number

type/negative

check for a negative number

type/nonnegative

check for a non-negative number

type/nonpositive

check for a non-positive number

 Calling Sequence type(x, positive) type(x, negative) type(x, nonnegative) type(x, nonpositive)

Parameters

 x - numeric type

Description

 • The functions type(x, positive), type(x, negative), type(x, nonnegative), and type(x, nonpositive) return true if x is a positive, negative, non-negative, or non-positive extended_numeric number, respectively. Otherwise, false is returned.

Examples

 > $\mathrm{type}\left(0,\mathrm{positive}\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{type}\left(-1.79,\mathrm{negative}\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(0,\mathrm{nonnegative}\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(-\mathrm{∞},\mathrm{nonpositive}\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{type}\left({x}^{2},\mathrm{nonnegative}\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{type}\left(\sqrt{8},\mathrm{positive}\right)$
 ${\mathrm{false}}$ (6)

 See Also

## Was this information helpful?

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