WOLFRAM

x-=dx

subtracts dx from x and returns the new value of x.

Details

Examples

open allclose all

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

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

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

Subtract from a numerical value:

Out[1]=1

Subtract from a symbolic value:

Out[1]=1

Subtract from all values in a list:

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

The first argument to SubtractFrom 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 last prime below one million:

Out[1]=1

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

SubtractFrom is a short form of this assignment:

Out[1]=1

PreDecrement is a special case of SubtractFrom:

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

AddTo is closely related:

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

Possible Issues  (1)Common pitfalls and unexpected behavior

A variable to be decremented must have an initial value:

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

Text

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

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.

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

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

BibTeX

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

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

BibLaTeX

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

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