Additional information: when you write 0.5, by default, in Java, it is a double. Processing doesn't use the double type, so when it compiles your sketch, it adds a f after all the floating point literals. That's why making a real double in Processing is harder than for floats. double x = 3.1415926535897932384; println(x); // Shows 3.1415927410125732! double x = 3.1415926535897932384d; println(x); // Shows 3.141592653589793
Weird coincidence. I'd run across this before, and didn't know what I was looking at either (not being a CS guy). So last night I decided to try to track it down. A cursory search of this forum didn't turn up anything (hard to search for "f"), but a wider search brought me to this:
So the "f" is one of several possible numeric literals.
In addition to the other already helpful responses, could some of the CS folk here comment more about when and how to use such literals? What do they add, in terms of both value and penalties (memory, performance, etc.)?
Happy to see the topic come up. Perhaps we can find a more search-friendly title for the post?