1

I feel really stupid asking this, but what is the correct way to write the second line of the following example in math notation?

Example (JavaScript)

var x = 2, y = 2;
x += 2 * y; // x = x + 2 * y

Would it be written as x := x + 2y?

j.doe
  • 133
  • 2
  • 1
    Some authors will use $\leftarrow$ where you have $:=$ but it would be written in the same form nonetheless. – Parcly Taxel Oct 16 '17 at 18:53
  • Just to be clear, what Parcly said applies to explaining algorithms in psuedocode. Outside of a context like that, math doesn't really do assignment-it's more like a functional programming language. – Mark S. Oct 16 '17 at 19:53

0 Answers0