type/prime - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

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

type/prime

check for a prime integer

 Calling Sequence type(expr, prime)

Parameters

 expr - expression

Description

 • This command returns true if expr is a prime integer, and false otherwise.
 • The isprime command is used to check the primality of expr, once expr has been determined to be an integer.

Examples

 > $\mathrm{type}\left(1,\mathrm{prime}\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{type}\left(2,\mathrm{prime}\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(-3,\mathrm{prime}\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{type}\left(17,\mathrm{prime}\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{type}\left(21,\mathrm{prime}\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{type}\left({2}^{{2}^{5}}+1,\mathrm{prime}\right)$
 ${\mathrm{false}}$ (6)
 > $\mathrm{type}\left({x}^{2}+1,\mathrm{prime}\right)$
 ${\mathrm{false}}$ (7)

 See Also

## Was this information helpful?

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