<p>Recently I tried understanding the use of <strong>java.math.MathContext</strong> but failed to understand properly. Is it used for rounding in <code>java.math.BigDecimal</code>. If yes why does not it round the decimal digits but even mantissa part.</p>

<p>From API docs, I came to know that it follows the standard specified in <code>ANSI X3.274-1996</code> and <code>ANSI X3.274-1996/AM 1-2000</code> specifications but I did not get them to read online.</p>

<p>Please let me know if you have any idea on this.</p>

If I'm understanding you correctly, it sounds like you're expecting the MathContext to control how many digits should be kept after the decimal point.  That's not what it's for.  It specifies how many digits to keep,
total
.  So if you specify that you want 3 significant digits, that's all you're going to get.
For example, this:
```
```
System.out.println(new BigDecimal("1234567890.123456789",
                   new MathContext(20)));

System.out.println(new BigDecimal("1234567890.123456789",
                   new MathContext(10)));

System.out.println(new BigDecimal("1234567890.123456789",
                   new MathContext(5)));
```
```
will output:
```
```
1234567890.123456789
1234567890
1.2346E+9
```
```