
-----------------------------------
Raknarg
Sun Mar 27, 2011 2:41 pm

+= and -=
-----------------------------------
Just a quick question about the language...
I've come across people using += and -= in their programs. I couldn't find any answers online or on the site, so could anyone tell me what it does?

-----------------------------------
DemonWasp
Sun Mar 27, 2011 2:48 pm

RE:+= and -=
-----------------------------------
Those are accumulate operators. They say "add everything on the right to the variable on the left".

The statement x += 5 is equivalent to x = x + 5.

-----------------------------------
Raknarg
Sun Mar 27, 2011 3:09 pm

RE:+= and -=
-----------------------------------
Oh. How convienient.
Oh, and one more: ~=

-----------------------------------
Insectoid
Sun Mar 27, 2011 3:23 pm

RE:+= and -=
-----------------------------------
in Turing that represents 'not equal to'. It's the same as writing 'not='. Most other languages use ! as the not operator.

-----------------------------------
Raknarg
Sun Mar 27, 2011 3:54 pm

RE:+= and -=
-----------------------------------
k thanks
