x-=dx
subtracts dx from x and returns the new value of x.
SubtractFrom 
x-=dx
subtracts dx from x and returns the new value of x.
Details
- x-=dx is equivalent to x=x-dx.
- SubtractFrom has the attribute HoldFirst.
- In SubtractFrom[x,dx], x can be a symbol or other expression with an existing value. »
Examples
open all close allBasic Examples (1)
k = 1;k -= 5kScope (4)
Subtract from a numerical value:
x = 1.5; x -= 0.75;xSubtract from a symbolic value:
v = a;v -= b;vSubtract from all values in a list:
x = {100, 200, 300}x -= 17;xx -= {20, 21, 22};xThe first argument to SubtractFrom need not be a symbol:
list = {1, 2, 3}list[[2]] -= clistApplications (1)
Properties & Relations (3)
SubtractFrom is a short form of this assignment:
k = 1;
k = k - 5PreDecrement is a special case of SubtractFrom:
k = 10;
k -= 1--kAddTo is closely related:
k = 10;
k -= 5k += -5Tech Notes
Related Guides
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), SubtractFrom, Wolfram Language function, https://reference.wolfram.com/language/ref/SubtractFrom.html.
CMS
Wolfram Language. 1988. "SubtractFrom." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SubtractFrom.html.
APA
Wolfram Language. (1988). SubtractFrom. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SubtractFrom.html
BibTeX
@misc{reference.wolfram_2026_subtractfrom, author="Wolfram Research", title="{SubtractFrom}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/SubtractFrom.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_subtractfrom, organization={Wolfram Research}, title={SubtractFrom}, year={1988}, url={https://reference.wolfram.com/language/ref/SubtractFrom.html}, note=[Accessed: 13-June-2026]}