This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.

I have this formula which divides an int by int and then multiplies it by 0.3, the I save this in variable "fre". according to my calculator variable fre should be 0.2, but my program returns 0.19999999999999998. I dont know what am I doing wrong?

Your calculator probably comes up with the same value as Java, or one like it, but just rounds it before displaying.

The short version is this: It's impossible to exactly represent 0.2 in a double, for basically the same reason that it's impossible to represent 1/3 in a finite number of digits in base-10.