
-----------------------------------
dehu87
Tue May 27, 2008 1:01 pm

What does += or *= mean?
-----------------------------------
Im new to turing and i saw a program that included += this symbol. My question is 
what does += or *= mean?

-----------------------------------
Dan
Tue May 27, 2008 1:14 pm

RE:What does += or *= mean?
-----------------------------------
saying somthing like

x += 1

is equlent to saying

x = x +1


The same goes for the * operation. Simpley put it means add (for +=) or times (for *=) the varible on the left by the stamnet on the right and store it back in the varible on the left.

-----------------------------------
isaiahk9
Tue May 27, 2008 3:07 pm

RE:What does += or *= mean?
-----------------------------------
To be exact,

x += 1

is equivalent to saying

x := x + 1

-----------------------------------
Sean
Tue May 27, 2008 3:28 pm

Re: What does += or *= mean?
-----------------------------------
That's identical to what Dan said.

-----------------------------------
Mackie
Tue May 27, 2008 3:29 pm

RE:What does += or *= mean?
-----------------------------------
Not really. There is a colon that dan missed.

-----------------------------------
Tony
Tue May 27, 2008 3:34 pm

RE:What does += or *= mean?
-----------------------------------
The colon was implied.

Generally speaking, = is the assignment operator, while == is the comparison for equality. So the difference is between pseudocode and Turing's syntax. Which in this case is negligible.

-----------------------------------
Dan
Tue May 27, 2008 6:32 pm

RE:What does += or *= mean?
-----------------------------------
For more useless facts, saying x = x + 1 in turing is only a warning and will still run the code in most versions ;), tho yes i was going for pseudocode.
