This is an automated email from the ASF dual-hosted git repository. aherbert pushed a commit to branch complex-gsoc-2022 in repository https://gitbox.apache.org/repos/asf/commons-numbers.git
commit 1042c9885e577b0872fe46a20234032ec6d631f0 Author: aherbert <aherb...@apache.org> AuthorDate: Thu Jul 28 10:34:25 2022 +0100 Reorder help functions to match the order from Complex --- .../org/apache/commons/numbers/complex/TestUtils.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/TestUtils.java b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/TestUtils.java index cefe109b..ad50560e 100644 --- a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/TestUtils.java +++ b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/TestUtils.java @@ -524,9 +524,9 @@ public final class TestUtils { } /** - * Computes the result of the subtraction of a complex number from an imaginary number. + * Computes the result of the subtraction of a complex number from a real number. * Implements the formula: - * \[ i d - (a + i b) = -a + i (d - b) \] + * \[ c - (a + i b) = (c - a) - i b \] * * <p>This method is a helper to replicate the method signature of the object-orientated * API in Complex (i.e. the complex argument is first) using the equivalent static API @@ -539,15 +539,15 @@ public final class TestUtils { * @param <R> the return type of the supplied action. * @return the object returned by the supplied action. */ - public static <R> R subtractFromImaginary(double real, double imaginary, double minuend, ComplexSink<R> action) { + public static <R> R subtractFrom(double real, double imaginary, double minuend, ComplexSink<R> action) { // Call the equivalent static API function - return ComplexFunctions.imaginarySubtract(minuend, real, imaginary, action); + return ComplexFunctions.realSubtract(minuend, real, imaginary, action); } /** - * Computes the result of the subtraction of a complex number from a real number. + * Computes the result of the subtraction of a complex number from an imaginary number. * Implements the formula: - * \[ c - (a + i b) = (c - a) - i b \] + * \[ i d - (a + i b) = -a + i (d - b) \] * * <p>This method is a helper to replicate the method signature of the object-orientated * API in Complex (i.e. the complex argument is first) using the equivalent static API @@ -560,8 +560,8 @@ public final class TestUtils { * @param <R> the return type of the supplied action. * @return the object returned by the supplied action. */ - public static <R> R subtractFrom(double real, double imaginary, double minuend, ComplexSink<R> action) { + public static <R> R subtractFromImaginary(double real, double imaginary, double minuend, ComplexSink<R> action) { // Call the equivalent static API function - return ComplexFunctions.realSubtract(minuend, real, imaginary, action); + return ComplexFunctions.imaginarySubtract(minuend, real, imaginary, action); } }