--x
decreases the value of x by 1, returning the new value of x.
PreDecrement 
--x
decreases the value of x by 1, returning the new value of x.
Details
- --x is equivalent to x=x-1.
- PreDecrement has attribute HoldFirst.
- In PreDecrement[x], x can be a symbol or other expression with an existing value. »
Examples
open all close allBasic Examples (1)
Scope (4)
x = 1.5; --x;xv = a;--v;vDecrement all values in a list:
x = {1, 2, 3}--x;xThe argument to PreDecrement need not be a symbol:
list = {1, 2, 3}--list[[2]]listApplications (1)
Properties & Relations (4)
Decrement and PreDecrement differ in the return value of the operation:
{a, b} = {1, 1};{a--, --b}{a, b}PreDecrement is a short form of this assignment:
k = 1;
k = k - 1PreDecrement is a special case of SubtractFrom:
k = 1;
k -= 1Increment and PreIncrement are closely related operations:
{a, b, c, d} = {1, 1, 1, 1};{a++, ++b, c--, --d}{a, b, c, d}See Also
Tech Notes
Related Guides
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), PreDecrement, Wolfram Language function, https://reference.wolfram.com/language/ref/PreDecrement.html.
CMS
Wolfram Language. 1988. "PreDecrement." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PreDecrement.html.
APA
Wolfram Language. (1988). PreDecrement. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PreDecrement.html
BibTeX
@misc{reference.wolfram_2026_predecrement, author="Wolfram Research", title="{PreDecrement}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/PreDecrement.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_predecrement, organization={Wolfram Research}, title={PreDecrement}, year={1988}, url={https://reference.wolfram.com/language/ref/PreDecrement.html}, note=[Accessed: 12-June-2026]}