top of page

BigDecimal in Java

  • Writer: Jonathan
    Jonathan
  • May 6, 2019
  • 1 min read

  • If you are dealing with money, or precision is a must, use BigDecimal. Otherwise Doubles tend to be good enough.

  • The disadvantage of BigDecimal is that it's slower, and it's a bit more difficult to program algorithms that way (due to +, -, * and / not being overloaded).

Example:


Result:


Comentarios


Single post: Blog_Single_Post_Widget
bottom of page