diff --git a/src/changes/changes.xml b/src/changes/changes.xml index e727dfe3a..6f5458390 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -54,6 +54,9 @@ If the output is not quite correct, check for invisible trailing spaces! + + Removed "ArithmeticUtils#pow(int, long)" and "ArithmeticUtils#pow(long, long)". + Method "LaguerreSolver#laguerre(...)" has been made private. diff --git a/src/main/java/org/apache/commons/math4/util/ArithmeticUtils.java b/src/main/java/org/apache/commons/math4/util/ArithmeticUtils.java index 027fa297c..d6262a565 100644 --- a/src/main/java/org/apache/commons/math4/util/ArithmeticUtils.java +++ b/src/main/java/org/apache/commons/math4/util/ArithmeticUtils.java @@ -678,34 +678,6 @@ public final class ArithmeticUtils { } } - /** - * Raise an int to a long power. - * - * @param k Number to raise. - * @param e Exponent (must be positive or zero). - * @return ke - * @throws NotPositiveException if {@code e < 0}. - * @deprecated As of 3.3. Please use {@link #pow(int,int)} instead. - */ - @Deprecated - public static int pow(final int k, long e) throws NotPositiveException { - if (e < 0) { - throw new NotPositiveException(LocalizedFormats.EXPONENT, e); - } - - int result = 1; - int k2p = k; - while (e != 0) { - if ((e & 0x1) != 0) { - result *= k2p; - } - k2p *= k2p; - e >>= 1; - } - - return result; - } - /** * Raise a long to an int power. * @@ -752,34 +724,6 @@ public final class ArithmeticUtils { } } - /** - * Raise a long to a long power. - * - * @param k Number to raise. - * @param e Exponent (must be positive or zero). - * @return ke - * @throws NotPositiveException if {@code e < 0}. - * @deprecated As of 3.3. Please use {@link #pow(long,int)} instead. - */ - @Deprecated - public static long pow(final long k, long e) throws NotPositiveException { - if (e < 0) { - throw new NotPositiveException(LocalizedFormats.EXPONENT, e); - } - - long result = 1l; - long k2p = k; - while (e != 0) { - if ((e & 0x1) != 0) { - result *= k2p; - } - k2p *= k2p; - e >>= 1; - } - - return result; - } - /** * Raise a BigInteger to an int power. * diff --git a/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java b/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java index 74c856493..525dbff1a 100644 --- a/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java +++ b/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java @@ -413,15 +413,6 @@ public class ArithmeticUtilsTest { // expected behavior } - Assert.assertEquals(1801088541l, ArithmeticUtils.pow(21l, 7l)); - Assert.assertEquals(1l, ArithmeticUtils.pow(21l, 0l)); - try { - ArithmeticUtils.pow(21l, -7l); - Assert.fail("Expecting MathIllegalArgumentException"); - } catch (MathIllegalArgumentException e) { - // expected behavior - } - BigInteger twentyOne = BigInteger.valueOf(21l); Assert.assertEquals(BigInteger.valueOf(1801088541l), ArithmeticUtils.pow(twentyOne, 7)); Assert.assertEquals(BigInteger.ONE, ArithmeticUtils.pow(twentyOne, 0));