code: public static BigDecimal acos(BigDecimal x, MathContext mathContext) {
  		checkMathContext(mathContext);
  		if (x.compareTo(ONE) > 0) {
  			throw new ArithmeticException("Illegal acos(x) for x > 1: x = " + x);
  		}
  		if (x.compareTo(MINUS_ONE) < 0) {
  			throw new ArithmeticException("Illegal acos(x) for x < -1: x = " + x);
  		}
  
  		MathContext mc = new MathContext(mathContext.getPrecision() + 6, mathContext.getRoundingMode());
  
  		BigDecimal result = pi(mc).divide(TWO, mc).subtract(asin(x, mc), mc);
  		return round(result, mathContext);
  	}
docs: Calculates the arc cosine (inverted cosine) of {@link BigDecimal} x.
  
  <p>See: <a href="http://en.wikipedia.org/wiki/Arccosine">Wikipedia: Arccosine</a></p>
  
  @param x the {@link BigDecimal} to calculate the arc cosine for
  @param mathContext the {@link MathContext} used for the result
  @return the calculated arc sine {@link BigDecimal} with the precision specified in the <code>mathContext</code>
  @throws ArithmeticException if x &gt; 1 or x &lt; -1
  @throws UnsupportedOperationException if the {@link MathContext} has unlimited precision