Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

MathContext.DECIMAL128

843789Dec 27 2009 — edited Dec 27 2009
I want to do a few preliminary calculations using BigDecimal,
but I must be doing something wrong.
At the beginning of the program I have
import java.math.MathContext; 
import java.math.BigDecimal; 
Then when I try to construct
MathContext mathContext=new MathContext(MathContext.DECIMAL128); //precision 34 digits 
BigDecimal bigDecimal=new BigDecimal(someLong,mathContext); 
I get the message
cannot find symbol constructor MathContext(java.math.MathContext) 
on the first of the two lines.
What am I doing wrong?

It evidently cannot find the integer DECIMAL128 in MathContext.
And I really do have a dot between MathContext and DECIMAL128.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 24 2010
Added on Dec 27 2009
5 comments
238 views