Sponsored links: Algebra eBooks

### The Maxima on-line user's manual

Algebra Calculator

#### Constantp

Function: constantp (<expr>) Returns true if <expr> is a constant expression, otherwise returns false.

An expression is considered a constant expression if its arguments are numbers (including rational numbers, as displayed with /R/), symbolic constants such as %pi, %e, and %i, variables bound to a constant or declared constant by declare, or functions whose arguments are constant.

constantp evaluates its arguments.

Examples:

(%i1) constantp (7 * sin(2));
(%o1)                                true
(%i2) constantp (rat (17/29));
(%o2)                                true
(%i3) constantp (%pi * sin(%e));
(%o3)                                true
(%i4) constantp (exp (x));
(%o4)                                false
(%i5) declare (x, constant);
(%o5)                                done
(%i6) constantp (exp (x));
(%o6)                                true
(%i7) constantp (foo (x) + bar (%e) + baz (2));
(%o7)                                false
(%i8)

(%o1)                                true
(%i2)

### Related Examples

? constantp;

Calculate

? constantp;

Calculate

##### constantp-log

constantp(log(2));

Calculate

##### constantp-plot2d

plot2d([-2*x-3, -2*x-...

constantp(NaN);

Calculate

##### constantp-false-lambda-log-matchdeclare-tellsimpafter

matchdeclare(X, lambd...

constantp(log(2));

tellsimpafter(log(X),...

Calculate

##### constantp-false-lambda-log-matchdeclare-tellsimpafter

matchdeclare(X, lambd...

constantp(log(2));

tellsimpafter(log(X),...

Calculate

##### constantp-declare-exp-rat-sin

constantp (7 * sin(2));

constantp (rat (17/2...

constantp (%pi * sin...

Calculate

##### constantp-plot2d

plot2d([-2*x-3, -2*x-...

constantp(NaN);

Calculate

##### constantp-plot2d

plot2d([-2*x-3, -2*x-...

constantp(%NaN);

Calculate

##### constantp-declare-exp-rat-sin

constantp (7 * sin(2));

constantp (rat (17/2...

constantp (%pi * sin...

Calculate