negint - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

type/posint

check for a positive integer

type/negint

check for a negative integer

type/nonnegint

check for a non-negative integer

type/nonposint

check for a non-positive integer

 Calling Sequence type(x, posint) type(x, negint) type(x, nonnegint) type(x, nonposint)

Parameters

 x - any expression

Description

 • The functions type(x, posint), type(x, negint), type(x, nonnegint), and type(x, nonposint) return true if x is a positive, negative, non-negative, or non-positive integer, respectively.  Otherwise, false is returned.

Supertypes

 •

Examples

 > $\mathrm{type}\left(3,\mathrm{posint}\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(-5,\mathrm{negint}\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(0,\mathrm{nonnegint}\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(x,\mathrm{negint}\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{type}\left(3.5,\mathrm{posint}\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{type}\left(-3,\mathrm{nonposint}\right)$
 ${\mathrm{true}}$ (6)