Increment, Decrement, and Compound Assignment — RexDac Academy

RexDac AcademyTechnical notes · Some prior knowledge helps
0%Published notes read · this device

Level 1 — The basics

Increment, Decrement, and Compound Assignment

Original notes by SunDiaL · View English source

These operators are a combination of arithmetic operations and variable assignment. They are

  • increment ++ -> x++ is equivalent to x = x + 1
  • decrement -- -> x-- is equivalent to x = x - 1
  • increment by += -> x+=2 is equivalent to x = x + 2
  • decrement by -= -> x-=2 is equivalent to x = x - 2