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

Online Help

All Products    Maple    MapleSim


type/constant

check for a constant

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

type(x, constant)

constants

constants := constants, y

Parameters

x

-

any expression

y

-

a symbol

Description

• 

The call type(x, constant) verifies whether x is a constant.

• 

The global variable constants is an expression sequence of all names which are initially known as symbolic constants in Maple.  These are: false, gamma, infinity, true, Catalan, FAIL and Pi.

• 

The values undefined and Float(undefined) do not appear on this list because neither is a constant.

• 

The user can declare any symbol other than undefined to be a constant by appending it to constants. In order to make the evalf command evaluate such a constant to a floating-point number, define a procedure of the form `evalf/constant/y`, where y is the name of the constant. This process is described on the detailed evalf help page.

• 

The numeric constants in Maple are integers, fractions, floating-point numbers, and complex numbers whose real and imaginary parts are any of these types of numbers.

• 

The expression (-1)^(1/2) is implemented as Complex(1).

• 

More generally, a Maple expression is of type constant if it is an unevaluated function with all arguments of type constant, or a sum, product, or power with all operands of type constant.

• 

Additionally, the RootOf function can be a constant. This is determined by calling the indets command on it. Suppose r is of the form RootOf(...). If indets(r, name) only returns entries that occur in constants, then r is a constant, and otherwise it is not.

Examples

(1)

(2)

(3)

(4)

(5)

(6)

(7)

(8)

(9)

(10)

(11)

(12)

Here are two examples of RootOf calls, one a constant, the other not:

(13)

(14)

(15)

(16)

(17)

(18)

See Also

evalf/details

float

fraction

integer

type

type/complex

type/complexcons

type/numeric

type/realcons

undefined

 


Download Help Document