Calculate the first argument raised to the power of the second.
This method only supports non-negative powers.
@param value The number to be raised.
@param power The exponent (must be positive).
@return {@code value} raised to {@code power}.
540456
public static long raiseToPower(int value, int power)
    {
        if (power < 0)
        {
            throw new IllegalArgumentException("This method does not support negative powers.");
        }
        long result = 1;
        for (int i = 0; i < power; i++)
        {
            result *= value;
        }
        return result;
    }
485060
private void ensurePowerOfTwo(String parameter, int number) {
        if (Integer.bitCount(number) > 1) {
            LOG.warn("Parameter {} should be power of two but was {}", parameter, number);
        }
    }
33214
def _power(ctx, number, power):
    
    return decimal_pow(conversions.to_decimal(number, ctx), conversions.to_decimal(power, ctx))
192699
public static final BigInteger getBigInteger(Number value)
   {
      BigInteger result = null;
      if (value != null)
      {
         if (value instanceof BigInteger)
         {
            result = (BigInteger) value;
         }
         else
         {
            result = BigInteger.valueOf(Math.round(value.doubleValue()));
         }
      }
      return (result);
   }
1226958
@NonNull
    public static Expression power(@NonNull Expression base, @NonNull Expression exponent) {
        if (base == null || exponent == null) {
            throw new IllegalArgumentException("base or exponent cannot be null.");
        }
        return new Expression.FunctionExpression("POWER()", Arrays.asList(base, exponent));
    }
531018
public static double pow(Number baseNumber, int exponent) {
        return exponent < 1 ? 1
                : exponent > 1
                ? baseNumber.doubleValue()
                * pow(baseNumber, exponent - 1)
                : baseNumber.doubleValue();
    }
1100791
public static BigInteger power(BigInteger self, BigInteger exponent) {
        if ((exponent.signum() >= 0) && (exponent.compareTo(BI_INT_MAX) <= 0)) {
            return self.pow(exponent.intValue());
        } else {
            return BigDecimal.valueOf(Math.pow(self.doubleValue(), exponent.doubleValue())).toBigInteger();
        }
    }
619505
public static void checkIfPowerOf2(final int v, final String argName) {
    if ((v > 0) && ((v & (v - 1)) == 0)) {
      return;
    }
    throw new SketchesArgumentException("The value of the parameter \"" + argName
        + "\" must be a positive integer-power of 2" + " and greater than 0: " + v);
  }
516216
protected Expression power() {
        Expression left = atom();
        if (tokenizer.current().isSymbol("^") || tokenizer.current().isSymbol("**")) {
            tokenizer.consume();
            Expression right = power();
            return reOrder(left, right, BinaryOperation.Op.POWER);
        }
        return left;
    }
1007816
@Override
	public double transform(double value) {
		double sqrtValue = Double.NEGATIVE_INFINITY;
		if(value >= 0)
			sqrtValue = Math.sqrt(value);

		return sqrtValue;
	}
11944
public double calculateValue(double value) {
		JexlContext context = new MapContext();
		context.set(getArg(), value);
		return (double) expression.evaluate(context);
	}
307651
public static ListDouble pow(final ListNumber data, final double expon) {
        return new ListDouble() {

            @Override
            public double getDouble(int index) {
                return Math.pow(data.getDouble(index), expon);
            }

            @Override
            public int size() {
                return data.size();
            }
        };
    }
25253
@Override
  public void setStrength(int value) {
    if (value < Collator.PRIMARY || value > Collator.IDENTICAL) {
      throw new IllegalArgumentException();
    }
    strength = value;
  }
582893
function(value) {
		var exp = Math.floor(helpers$1.log10(value));
		var significand = Math.floor(value / Math.pow(10, exp));

		return significand * Math.pow(10, exp);
	}
787042
@Override
    public Geldbetrag scaleByPowerOfTen(int power) {
        BigDecimal scaled =
                betrag.scaleByPowerOfTen(power).setScale(context.getMaxScale(), context.get(RoundingMode.class));
        return Geldbetrag.valueOf(scaled, getCurrency(), context);
    }
1010351
public static long pow(long b, int k) {
        checkNonNegative("exponent", k);
        if (-2 <= b && b <= 2) {
            switch ((int) b) {
                case 0:
                    return (k == 0) ? 1 : 0;
                case 1:
                    return 1;
                case (-1):
                    return ((k & 1) == 0) ? 1 : -1;
                case 2:
                    return (k < Long.SIZE) ? 1L << k : 0;
                case (-2):
                    if (k < Long.SIZE) {
                        return ((k & 1) == 0) ? 1L << k : -(1L << k);
                    } else {
                        return 0;
                    }
                default:
                    throw new AssertionError();
            }
        }
        for (long accum = 1;; k >>= 1) {
            switch (k) {
                case 0:
                    return accum;
                case 1:
                    return accum * b;
                default:
                    accum *= ((k & 1) == 0) ? 1 : b;
                    b *= b;
            }
        }
    }
598959
@Override
    public Money scaleByPowerOfTen(int power) {
        return new Money(this.number.scaleByPowerOfTen(power), getCurrency(),
                monetaryContext);
    }