docs: public static BigDecimal pow(BigDecimal x, long y, MathContext mathContext) {
  		MathContext mc = mathContext.getPrecision() == 0 ? mathContext : new MathContext(mathContext.getPrecision() + 10, mathContext.getRoundingMode());
  
  		// TODO optimize y=0, y=1, y=10^k, y=-1, y=-10^k
  
  		if (y < 0) {
  			BigDecimal value = reciprocal(pow(x, -y, mc), mc);
  			return round(value, mathContext);
  		}
  		
  		BigDecimal result = ONE;
  		while (y > 0) {
  			if ((y & 1) == 1) {
  				// odd exponent -> multiply result with x
  				result = result.multiply(x, mc);
  				y -= 1;
  			}
  			
  			if (y > 0) {
  				// even exponent -> square x
  				x = x.multiply(x, mc);
  			}
  			
  			y >>= 1;
  		}
  
  		return round(result, mathContext);
  	}