commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aherb...@apache.org
Subject [commons-numbers] 03/07: Remove BigFraction.pow(double).
Date Thu, 09 Apr 2020 11:34:45 GMT
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git

commit e0582a914b7901cfb840603a038e941fc975690c
Author: aherbert <aherbert@apache.org>
AuthorDate: Thu Apr 9 12:12:38 2020 +0100

    Remove BigFraction.pow(double).
---
 .../org/apache/commons/numbers/fraction/BigFraction.java     | 12 ------------
 .../org/apache/commons/numbers/fraction/BigFractionTest.java |  1 -
 2 files changed, 13 deletions(-)

diff --git a/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/BigFraction.java
b/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/BigFraction.java
index a4a14a4..ded343b 100644
--- a/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/BigFraction.java
+++ b/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/BigFraction.java
@@ -954,18 +954,6 @@ public final class BigFraction
     }
 
     /**
-     * Returns a {@code double} whose value is
-     * <code>this<sup>exponent</sup></code>.
-     *
-     * @param exponent exponent to which this {@code BigFraction} is to be raised.
-     * @return <code>this<sup>exponent</sup></code> as a {@code double}.
-     */
-    public double pow(final double exponent) {
-        return Math.pow(numerator.doubleValue(),   exponent) /
-               Math.pow(denominator.doubleValue(), exponent);
-    }
-
-    /**
      * Returns the {@code String} representing this fraction.
      * Uses:
      * <ul>
diff --git a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java
b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java
index a33cf1b..1f0f52e 100644
--- a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java
+++ b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java
@@ -653,7 +653,6 @@ public class BigFractionTest {
         Assertions.assertEquals(BigFraction.ZERO, BigFraction.of(0, 5).pow(123));
         Assertions.assertEquals(BigFraction.ZERO, BigFraction.of(0, 5).pow(123L));
         Assertions.assertEquals(BigFraction.ZERO, BigFraction.of(0, 5).pow(new BigInteger("112233445566778899")));
-        Assertions.assertEquals(Math.sqrt(2d / 3), BigFraction.of(2, 3).pow(0.5), 1e-15);
     }
 
     @Test


Mime
View raw message