BigInteger result = BigInteger.ONE; while (exponent.signum() > 0) { if (exponent.testBit(0)) result = result.multiply(base); base = base.multiply(base); exponent = exponent.shiftRight(1); return result; ...
BigInteger powerResultat = new BigInteger("1"); if (exp == 1) { return base; if (exp == 0) { return powerResultat; for (int i = 0; i < exp; ++i) { ...
BigDecimal hoursPerPtu = new BigDecimal(Hours.ONE.toStandardMinutes().getMinutes()) .divide(new BigDecimal(ptuDuration), DECIMAL_PRECISION, RoundingMode.HALF_UP); return new BigDecimal(power).divide(hoursPerPtu, DECIMAL_PRECISION, RoundingMode.HALF_UP).toBigInteger();