Java run-time error “ Non-terminating decimal expansion; no exact representable decimal result” in BigDecimal class?

You probably need to use one of the divide methods that specify the rounding mode Read also here.

You probably need to use one of the divide methods that specify the rounding mode. Read also here.

Yes, been bitten by this one before. – time4tea Jan 13 at 10:34.

This happens when you do 1/3 on BigDecimal and don't specify how precise the result should be and what the round method should be like. See javadoc (download.oracle.com/javase/6/docs/api/ja...) You may use a MathContext object to wrap up precision and roundupMethod together. You may also choose to specify it directly.

Add that information to constructor or when calling divide are both ok.

Divide method throws this exception if the resulting number have infinite decimal expansion. In this case, you need to provide a MathContext, which will define how the number will be rounded, so that it have a finite value.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions