Author |
Message |
Raknarg

|
Posted: Sun Mar 27, 2011 2:41 pm Post subject: += 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? |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
DemonWasp
|
Posted: Sun Mar 27, 2011 2:48 pm Post subject: 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

|
Posted: Sun Mar 27, 2011 3:09 pm Post subject: RE:+= and -= |
|
|
Oh. How convienient.
Oh, and one more: ~= |
|
|
|
|
 |
Insectoid

|
Posted: Sun Mar 27, 2011 3:23 pm Post subject: 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

|
Posted: Sun Mar 27, 2011 3:54 pm Post subject: RE:+= and -= |
|
|
k thanks |
|
|
|
|
 |
|