diff --git a/src/main/java/org/apache/commons/math3/RealFieldElement.java b/src/main/java/org/apache/commons/math3/RealFieldElement.java index e9d041f53..420eca40f 100644 --- a/src/main/java/org/apache/commons/math3/RealFieldElement.java +++ b/src/main/java/org/apache/commons/math3/RealFieldElement.java @@ -205,10 +205,12 @@ public interface RealFieldElement extends FieldElement { */ T log1p(); - /** Base 10 logarithm. - * @return base 10 logarithm of the instance - */ - T log10(); +// TODO: add this method in 4.0, as it is not possible to do it in 3.2 +// due to incompatibility of the return type in the Dfp class +// /** Base 10 logarithm. +// * @return base 10 logarithm of the instance +// */ +// T log10(); /** Cosine operation. * @return cos(this) diff --git a/src/main/java/org/apache/commons/math3/analysis/differentiation/DerivativeStructure.java b/src/main/java/org/apache/commons/math3/analysis/differentiation/DerivativeStructure.java index fef9a42b0..dd7f98e42 100644 --- a/src/main/java/org/apache/commons/math3/analysis/differentiation/DerivativeStructure.java +++ b/src/main/java/org/apache/commons/math3/analysis/differentiation/DerivativeStructure.java @@ -621,7 +621,9 @@ public class DerivativeStructure implements RealFieldElement { return DfpMath.log(this.add(getOne())); } - /** {@inheritDoc} - * @since 3.2 +// TODO: deactivate this implementation (and return type) in 4.0 + /** Get the exponent of the greatest power of 10 that is less than or equal to abs(this). + * @return integer base 10 logarithm + * @deprecated as of 3.2, replaced by {@link #intLog10()}, in 4.0 the return type + * will be changed to Dfp */ - public Dfp log10() { - return DfpMath.log(this).divide(DfpMath.log(newInstance(10))); + @Deprecated + public int log10() { + return intLog10(); } +// TODO: activate this implementation (and return type) in 4.0 +// /** {@inheritDoc} +// * @since 3.2 +// */ +// public Dfp log10() { +// return DfpMath.log(this).divide(DfpMath.log(newInstance(10))); +// } + /** {@inheritDoc} * @since 3.2 */ diff --git a/src/main/java/org/apache/commons/math3/util/Decimal64.java b/src/main/java/org/apache/commons/math3/util/Decimal64.java index f3cc616da..1e3e12fe1 100644 --- a/src/main/java/org/apache/commons/math3/util/Decimal64.java +++ b/src/main/java/org/apache/commons/math3/util/Decimal64.java @@ -442,7 +442,9 @@ public class Decimal64 extends Number return new Decimal64(FastMath.log1p(value)); } - /** {@inheritDoc} */ + /** Base 10 logarithm. + * @return base 10 logarithm of the instance + */ public Decimal64 log10() { return new Decimal64(FastMath.log10(value)); } diff --git a/src/test/java/org/apache/commons/math3/ExtendedFieldElementAbstractTest.java b/src/test/java/org/apache/commons/math3/ExtendedFieldElementAbstractTest.java index fab4618b9..76e9cd548 100644 --- a/src/test/java/org/apache/commons/math3/ExtendedFieldElementAbstractTest.java +++ b/src/test/java/org/apache/commons/math3/ExtendedFieldElementAbstractTest.java @@ -312,12 +312,14 @@ public abstract class ExtendedFieldElementAbstractTest