Function: math[inc], math[dec] - increase/decrease value of a variable

Calling Sequence:

inc(x);
inc(x, n);
dec(x);
dec(x, n);

Parameters:

x - the name of a variable

n - a numeric value

Description:

In the first form, inc increases the value of the variable x by adding the value 1.

In the second form, inc increases the value of the variable x by adding the value n.

In the first form, dec decreases the value of the variable x by subtracting the value 1.

In the second form, dec decreases the value of the variable x by subtracting the value n.

The return is the increased or decreased value of x, i.e. x is assigned the computed value.

This function is part of the math package, and so can be used only after performing the command with(math) or with(math, inc) resp. with(math, dec).

Examples:

> with(math):

> x := 1:

> inc(x);

[Maple Math]

> x;

[Maple Math]

> dec(x);

[Maple Math]

> inc(x, 2);

[Maple Math]

> dec(x, 0.5);

[Maple Math]

See Also:

Version History:

Version 1.0 - March 14, 1998