What is the value of x?

edited October 2016 in Programming Questions

Can someone help me with example 5.8 from the book Make: Getting Started with Processing (page 54)? I don't understand the use of variable x in the following line of code:

x += (targetX - x) * easing;

x is declared as a global variable of type float at the beginning of the sketch, but never initialized before this line. My question is: how can x be used inside its own initialization (targetX - x)? What is the value of x in this expression when it hasn't been assigned one at this point? Is Processing using a default value of 0.0?

Thank you in advance.

Answers

Sign In or Register to comment.