You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "HaraldKi (via GitHub)" <gi...@apache.org> on 2023/09/30 08:30:49 UTC

[GitHub] [commons-numbers] HaraldKi commented on a diff in pull request #138: Introduces isZero to Addition.java and isOne to Mulitplication.java

HaraldKi commented on code in PR #138:
URL: https://github.com/apache/commons-numbers/pull/138#discussion_r1341929612


##########
commons-numbers-core/src/main/java/org/apache/commons/numbers/core/Multiplication.java:
##########
@@ -44,4 +44,12 @@ public interface Multiplication<T> {
      * @return <code>this<sup>-1</sup></code>.
      */
     T reciprocal();
+
+    /**
+     * Is this the neutral element of multiplication? Implementations may want to
+     * employ more efficient means than calling equals on the one element.
+     *
+     * @return {@code true} if {@code this} equals the result of {@link #one}.
+     */
+    boolean isOne();

Review Comment:
   In fact I had these first, only to see the code coverage fail, so I first removed these again to see how the acceptance of this PR is at all. I'll add the defaults again and introduce test classes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org