AddTo

x+=dx

adds dx to x and returns the new value of x.

Details

Examples

open allclose all

Basic Examples  (1)

Scope  (3)

Add to a numerical value:

Add to a symbolic value:

Add to all values in a list:

Applications  (1)

Find the first prime above one million:

Properties & Relations  (4)

AddTo is a short form of this assignment:

PreIncrement is a special case of AddTo:

SubtractFrom is closely related:

A related operation for lists is AppendTo:

Possible Issues  (1)

A variable to be incremented must have an initial value:

Introduced in 1988
 (1.0)