Exemplo n.º 1
0
 /**
  * Returns a new {@code BigDecimal} whose value is {@code this ^ n}. The
  * result is rounded according to the passed context {@code mc}.
  * <p>
  * Implementation Note: The implementation is based on the ANSI standard
  * X3.274-1996 algorithm.
  *
  * @param n
  *            exponent to which {@code this} is raised.
  * @param mc
  *            rounding mode and precision for the result of this operation.
  * @return {@code this ^ n}.
  * @throws ArithmeticException
  *             if {@code n < 0} or {@code n > 999999999}.
  */
 public static BigDecimal Pow(BigDecimal number, int exp, MathContext context)
 {
     return(BigDecimalMath.Pow(number, exp, context));
 }
Exemplo n.º 2
0
 /**
  * Returns a new {@code BigDecimal} whose value is {@code this ^ n}. The
  * scale of the result is {@code n} times the scales of {@code this}.
  * <p>
  * {@code x.pow(0)} returns {@code 1}, even if {@code x == 0}.
  * <p>
  * Implementation Note: The implementation is based on the ANSI standard
  * X3.274-1996 algorithm.
  *
  * @param n
  *            exponent to which {@code this} is raised.
  * @return {@code this ^ n}.
  * @throws ArithmeticException
  *             if {@code n < 0} or {@code n > 999999999}.
  */
 public static BigDecimal Pow(BigDecimal number, int exp)
 {
     return(BigDecimalMath.Pow(number, exp));
 }