Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Constantp Calculator

Constantp

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

constantp (7 * sin(2));
 constantp (rat (17/29));
 constantp (%pi * sin(%e));
 constantp (exp (x));
 declare (x, constant);
 constantp (exp (x));
 constantp (foo (x) + bar (%e) + baz (2));

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) 

Constantp Example

Related Examples

constantp-plot2d
plot2d([-2*x-3, -2*x-5, -2*x-7, 2*x+1,if abs(x+4) <1 then NaN else-2*x-7-4/(x+4),[parametric, 4*a-4+1/a, 4*a^2-4*a+5-2/a,[a,-2,-1/8], [ nticks, 1000]],[parametric, 4*a-4+1/a, 4*a^2-4*a+5-2/a,[a,1/8,2], [ nticks, 1000]]],[x,-12.5,4.5], [color, black,black,black,black,red, blue,blue]/*, [y,-15, 25]*/);

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

constantp(%NaN);

Calculate

constantp-plot2d
plot2d([-2*x-3, -2*x-5, -2*x-7, 2*x+1,if abs(x+4) <1 then inf else-2*x-7-4/(x+4),[parametric, 4*a-4+1/a, 4*a^2-4*a+5-2/a,[a,-2,-1/8], [ nticks, 1000]],[parametric, 4*a-4+1/a, 4*a^2-4*a+5-2/a,[a,1/8,2], [ nticks, 1000]]],[x,-12.5,4.5], [color, black,black,black,black,red, blue,blue]/*, [y,-15, 25]*/);

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

constantp(inf);

Calculate

constantp

? constantp;

Calculate

constantp-plot2d
plot2d([-2*x-3, -2*x-5, -2*x-7, 2*x+1,if abs(x+4) <1 then NaN else-2*x-7-4/(x+4),[parametric, 4*a-4+1/a, 4*a^2-4*a+5-2/a,[a,-2,-1/8], [ nticks, 1000]],[parametric, 4*a-4+1/a, 4*a^2-4*a+5-2/a,[a,1/8,2], [ nticks, 1000]]],[x,-12.5,4.5], [color, black,black,black,black,red, blue,blue]/*, [y,-15, 25]*/);

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

constantp-plot2d
plot2d([-2*x-3, -2*x-5, -2*x-7, 2*x+1,if abs(x+4) <1 then NaN else-2*x-7-4/(x+4),[parametric, 4*a-4+1/a, 4*a^2-4*a+5-2/a,[a,-2,-1/8], [ nticks, 1000]],[parametric, 4*a-4+1/a, 4*a^2-4*a+5-2/a,[a,1/8,2], [ nticks, 1000]]],[x,-12.5,4.5], [color, black,black,black,black,red, blue,blue]/*, [y,-15, 25]*/);

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

constantp(%NaN);

Calculate

constantp-plot2d
plot2d([-2*x-3, -2*x-5, -2*x-7, 2*x+1,if abs(x+4) <1 then inf else-2*x-7-4/(x+4),[parametric, 4*a-4+1/a, 4*a^2-4*a+5-2/a,[a,-2,-1/8], [ nticks, 1000]],[parametric, 4*a-4+1/a, 4*a^2-4*a+5-2/a,[a,1/8,2], [ nticks, 1000]]],[x,-12.5,4.5], [color, black,black,black,black,red, blue,blue]/*, [y,-15, 25]*/);

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

constantp(inf);

Calculate

constantp

? constantp;

Calculate

constantp-plot2d
plot2d([-2*x-3, -2*x-5, -2*x-7, 2*x+1,if abs(x+4) <1 then NaN else-2*x-7-4/(x+4),[parametric, 4*a-4+1/a, 4*a^2-4*a+5-2/a,[a,-2,-1/8], [ nticks, 1000]],[parametric, 4*a-4+1/a, 4*a^2-4*a+5-2/a,[a,1/8,2], [ nticks, 1000]]],[x,-12.5,4.5], [color, black,black,black,black,red, blue,blue]/*, [y,-15, 25]*/);

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