Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Defining Variables and Functions > Assignments > PreIncrement (++) >

PreIncrement

++x
increases the value of x by 1, returning the new value of x.
  • ++x is equivalent to .
Increment the value by 1 and return the new value:
Increment the value by 1 and return the new value:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Increment a numerical value:
Increment a symbolic value:
Increment all values in a list:
Find the first integer with a certain property:
Increment and PreIncrement differ in the return value of the operation:
PreIncrement is a short form of this assignment:
PreIncrement is a special case of AddTo:
Decrement and PreDecrement are closely related operations:
A variable to be incremented must have an initial value:
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF