WOLFRAM

++x

increases the value of x by 1, returning the new value of x.

Details

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Increment the value by 1 and return the new value:

Out[1]=1
Out[2]=2

Scope  (4)Survey of the scope of standard use cases

Increment a numerical value:

Out[1]=1

Increment a symbolic value:

Out[1]=1

Increment all values in a list:

Out[1]=1
Out[2]=2

The argument to PreIncrement need not be a symbol:

Out[1]=1
Out[2]=2
Out[3]=3

Applications  (1)Sample problems that can be solved with this function

Find the first integer with a certain property:

Out[1]=1

Properties & Relations  (4)Properties of the function, and connections to other functions

Increment and PreIncrement differ in the return value of the operation:

Out[2]=2
Out[3]=3

PreIncrement is a short form of this assignment:

Out[1]=1

PreIncrement is a special case of AddTo:

Out[1]=1

Decrement and PreDecrement are closely related operations:

Out[2]=2
Out[3]=3

Possible Issues  (1)Common pitfalls and unexpected behavior

A variable to be incremented must have an initial value:

Out[1]=1
Wolfram Research (1988), PreIncrement, Wolfram Language function, https://reference.wolfram.com/language/ref/PreIncrement.html.
Wolfram Research (1988), PreIncrement, Wolfram Language function, https://reference.wolfram.com/language/ref/PreIncrement.html.

Text

Wolfram Research (1988), PreIncrement, Wolfram Language function, https://reference.wolfram.com/language/ref/PreIncrement.html.

Wolfram Research (1988), PreIncrement, Wolfram Language function, https://reference.wolfram.com/language/ref/PreIncrement.html.

CMS

Wolfram Language. 1988. "PreIncrement." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PreIncrement.html.

Wolfram Language. 1988. "PreIncrement." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PreIncrement.html.

APA

Wolfram Language. (1988). PreIncrement. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PreIncrement.html

Wolfram Language. (1988). PreIncrement. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PreIncrement.html

BibTeX

@misc{reference.wolfram_2025_preincrement, author="Wolfram Research", title="{PreIncrement}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/PreIncrement.html}", note=[Accessed: 17-May-2025 ]}

@misc{reference.wolfram_2025_preincrement, author="Wolfram Research", title="{PreIncrement}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/PreIncrement.html}", note=[Accessed: 17-May-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_preincrement, organization={Wolfram Research}, title={PreIncrement}, year={1988}, url={https://reference.wolfram.com/language/ref/PreIncrement.html}, note=[Accessed: 17-May-2025 ]}

@online{reference.wolfram_2025_preincrement, organization={Wolfram Research}, title={PreIncrement}, year={1988}, url={https://reference.wolfram.com/language/ref/PreIncrement.html}, note=[Accessed: 17-May-2025 ]}