PreIncrement
✖
PreIncrement
increases the value of x by 1, returning the new value of x.
Details

- ++x is equivalent to x=x+1.
- PreIncrement has attribute HoldFirst.
- In PreIncrement[x], x can be a symbol or other expression with an existing value. »
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Scope (4)Survey of the scope of standard use cases

https://wolfram.com/xid/0b8c4lni0y-3mn70w


https://wolfram.com/xid/0b8c4lni0y-2dqqdg

Increment all values in a list:

https://wolfram.com/xid/0b8c4lni0y-boaay


https://wolfram.com/xid/0b8c4lni0y-2v76mu

The argument to PreIncrement need not be a symbol:

https://wolfram.com/xid/0b8c4lni0y-5axyxt


https://wolfram.com/xid/0b8c4lni0y-s6reew


https://wolfram.com/xid/0b8c4lni0y-tck70d

Applications (1)Sample problems that can be solved with this function
Properties & Relations (4)Properties of the function, and connections to other functions
Increment and PreIncrement differ in the return value of the operation:

https://wolfram.com/xid/0b8c4lni0y-jd4rit

https://wolfram.com/xid/0b8c4lni0y-i3im0b


https://wolfram.com/xid/0b8c4lni0y-dikf4d

PreIncrement is a short form of this assignment:

https://wolfram.com/xid/0b8c4lni0y-5h1xz5

PreIncrement is a special case of AddTo:

https://wolfram.com/xid/0b8c4lni0y-lk1x9y

Decrement and PreDecrement are closely related operations:

https://wolfram.com/xid/0b8c4lni0y-krw5xl

https://wolfram.com/xid/0b8c4lni0y-hx12qy


https://wolfram.com/xid/0b8c4lni0y-bvd0m5

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
]}
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
]}