Programming Tutorials

Comment on Tutorial - float vs double data types in Java By Baski



Comment Added by : rangzen

Comment Added at : 2014-03-28 09:31:47

Comment on Tutorial : float vs double data types in Java By Baski
"For example, float can be useful when representing dollars and cents."

No.

Check "Learning the Java Language / Language Basics / Primitive Data Types" : "This data type should never be used for precise values, such as currency. For that, you will need to use the java.math.BigDecimal class instead."


View Tutorial