Mathematica > Core Language > Defining Variables and Functions > Assignments > SubtractFrom (-=) >

SubtractFrom


subtracts dx from x and returns the new value of x.
  • is equivalent to .
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Subtract from a numerical value:
Subtract from a symbolic value:
Subtract from all values in a list:
Find the last prime below one million:
SubtractFrom is a short form of this assignment:
PreDecrement is a special case of SubtractFrom:
AddTo is closely related:
A variable to be decremented must have an initial value:
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF