We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Can't define float type in eclipse
Page Index Toggle Pages: 1
Can't define float type in eclipse (Read 1727 times)
Can't define float type in eclipse
Sep 1st, 2009, 8:12pm
 
nowadays I am trying to use Eclipse to code but found error by defining float type as below.

private float num = 0.2;

error message: 'Type mismatch: cannot convert from double to float'

Could you give me any idea about this? and I expect using eclipse allows me much easier coding compared to Processing IDE. is it right?
Re: Can't define float type in eclipse
Reply #1 - Sep 1st, 2009, 10:05pm
 
i switched back to PDE when using eclipse for some days but i believe you have to add f to your float private float num = 0.2f;
should work...
Re: Can't define float type in eclipse
Reply #2 - Sep 2nd, 2009, 7:28am
 
Yes, that's an habit Processing makes us loose, because he spoils us by automatically adding this 'f' on all literal numbers with decimal point.
Page Index Toggle Pages: 1