Outside of a scientific or engineering context, the use of float and double (and the corresponding wrapper classes Float and Double ) should likely be avoided. The fundamental problem is that rounding errors will always occur when using these data types - they are unavoidable.
From an IBM article on this topic :
"...binary floating-point arithmetic should not be used for financial, commercial, and user-centric applications or web services because the decimal data used in these applications cannot be represented exactly using binary floating-point."
From an article by Brian Goetz :
"...it is a bad idea to use floating point to try to represent
exact quantities like monetary amounts. Using floating point for dollars-and-cents calculations is a
recipe for disaster. Floating point numbers are best reserved for values such as measurements, whose
values are fundamentally inexact to begin with."