type/algnum - Maple Programming Help

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

type/algnum

check for an algebraic number

 Calling Sequence type(expr, algnum)

Parameters

 expr - any expression

Description

 • The call type(expr, algnum) checks whether expr is an algebraic number.
 • An algebraic number is defined as either a rational number, or a root of a univariate polynomial with algebraic number coefficients specified by a RootOf. A sum, product, or quotient of these is also an algebraic number.

Examples

 > $\mathrm{type}\left(\frac{2}{3},\mathrm{algnum}\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(\mathrm{ln}\left(2\right),\mathrm{algnum}\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{type}\left(\mathrm{RootOf}\left({z}^{2}+1,z\right),\mathrm{algnum}\right)$
 ${\mathrm{true}}$ (3)

Note: $\sqrt{2}$ is not of type algnum, but if written in the form RootOf(z^2-2, z) it is of type algnum.

 > $\mathrm{type}\left({2}^{\frac{1}{2}},\mathrm{algnum}\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{type}\left(\frac{5}{\mathrm{RootOf}\left({z}^{2}-2,z\right)},\mathrm{algnum}\right)$
 ${\mathrm{true}}$ (5)
 > $\mathrm{type}\left(\mathrm{RootOf}\left({z}^{2}+y,z\right),\mathrm{algnum}\right)$
 ${\mathrm{false}}$ (6)