Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Java
  3. Question
Java

ArithmeticException: “Non-terminating decimal expansion; no exact representable decimal result”

Asked by Aditya Yadav Jun 6, 2021 2.7K views 1 answer
Share

About this question

Why does the following code raise the exception shown below?

BigDecimal a = new BigDecimal("1.6");
BigDecimal b = new BigDecimal("9.2");
a.divide(b) // results in the following exception.

--

java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.

Your answer

1 Answer

More Java discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Java Blogs

Guides, tips and career advice on Java from JanBask experts.