Skip to content

Instantly share code, notes, and snippets.

@sysnajar
Created February 18, 2014 10:23
Show Gist options
  • Save sysnajar/9068243 to your computer and use it in GitHub Desktop.
Save sysnajar/9068243 to your computer and use it in GitHub Desktop.
java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.
To fix, you need to do something like this:
a.divide(b, 2, RoundingMode.HALF_UP)
where 2 is precision and RoundingMode.HALF_UP is rounding mode
http://stackoverflow.com/questions/4591206/arithmeticexception-non-terminating-decimal-expansion-no-exact-representable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment