This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / Assignments  /
SubtractFrom

  • x -= dx subtracts dx from x and returns the new value of x.
  • SubtractFrom has the attribute HoldFirst.
  • x -= dx is equivalent to x = x - dx.
  • See the Mathematica book: Section 2.4.4.
  • See also: Decrement, PreDecrement, Set.

    Further Examples

    This initializes the variable i to the value 7, subtracts from it, checks its value, and clears it.

    In[1]:=

    Out[1]=

    In[2]:=

    Out[2]=

    In[3]:=

    Out[3]=

    In[4]:=