This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

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