If you want exact decimal values, use
BigDecimal. Otherwise, learn how binary floating point works, and be prepared to deal with the consequences. (Even
BigDecimal won't be able to represent something like "a third" exactly, of course.)
Note that it's quite odd to call
Float.parseFloat, but assign the result to a
double... it would be more usual to either assign the result to a
float or to use
Double.parseDouble to start with. In either case, however, the result will not be exactly 9.99. The number 9.99 can't be represented exactly in binary floating point any more than the result of dividing one by three can be written exactly in a decimal representation.
I don't have any articles about Java binary floating point in particular, but there shouldn't be any really significant differences between that and C# binary floating point, which I do have an article about.
Which type you should use really depends on the semantics of what you're representing. I use a rule of thumb that manmade "artificial" values such as money are best represented in decimal formats (e.g.
BigDecimal) whereas "natural" values such as height and width are more appropriate as