Assignment Operations

Top 

Note. The value of expression containing the assignment operation is the value of the left operand after the assignment.

=  Usage: v = e

  The value of e is assigned to variable v.

  Example:

    x = y;

Note. The following operations combine arithmetic or bit-by-bit operations with the assignment operation.

+=  Usage: av += ae

   Increasing av by ae.

   Example:

     y += 2;

 

-=  Usage: av -= ae

   Decreasing av by ae.

   Example:

     x -= 3;

*=  Usage: av *= ae

   Multiplication of av by ae.

   Example:

     timesx *= x;

/=  Usage: av /= ae

   Division of av by ae.

   Example:

     x /= 2;

%=  Usage: iv %= ie

   The value of iv in modulus ie.

   Example:

     x %= 10;

>>= Usage: iv >>= ie

   The right ie bit shift of the iv binary form.

   Example:

     x >>= 4;

Usage: iv <<= ie

   The left ie bit shift of the iv binary form.

   Example:

     x <<= 1;

&=  Usage: iv &= ie

   The bit-by-bit AND operation of the iv and ie binary forms.

   Example:

     remitems &= mask;

^=  Usage: iv = ie

   The bit-by-bit exclusive OR operation of the iv and ie binary forms.

   Example:

     control ^= seton;

|=  Usage: iv |= ie

   The bit-by-bit OR operation of the iv and ie binary forms.

   Example:

     additems |= mask;