oracle - Java double data type should never be used for precise values, such as currency? -
this question has answer here:
- double vs. bigdecimal? 6 answers
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
Post a Comment