oracle - Java double data type should never be used for precise values, such as currency? -


this question has answer here:

when review official oracle java tutorial variables datatypes
http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html

i surprised when read that
java double data type should never used precise values, such currency !

can 1 why?
, best practice used precise values, such currency?

best data type amount fields bigdecimal. joshua bloch explains in article in effective java why should used accurate precision.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -