I\'m porting some code over from Processing to Java, and one issue I\'ve come across is that processing\'s precompiler turns any doubles to floats. In Eclipse however, I\'ve
In your first example, the f suffix is only valid directly on literals, not after a whole expression. So write it in either of those ways (assuming springing is a float[]):
springing[n] = .05f*(.17f*(n+1));
springing[n] = (float)( .05*(.17*(n+1)));
The first does the whole calculation (apart from the n+1 part) in float, the second one calculates in double and then converts only the result to float.
(And in both cases, the parenthesis between .05 and .17 (and the matching one) is usually superfluous, since multiplication is associative. It might do some difference for really big values of n, but in these cases you would usually want the other way to avoid overflow.)