commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aherb...@apache.org
Subject [commons-numbers] 02/08: Fraction: Document possible exception thrown by reciprocal()
Date Wed, 08 Apr 2020 21:17:20 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 ddc1ee77d15a915632c215fb6a49987500bff16a
Author: Alex Herbert <aherbert@apache.org>
AuthorDate: Wed Apr 8 21:27:31 2020 +0100

    Fraction: Document possible exception thrown by reciprocal()
---
 .../main/java/org/apache/commons/numbers/fraction/Fraction.java    | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
b/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
index 2ab8932..85ee30d 100644
--- a/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
+++ b/commons-numbers-fraction/src/main/java/org/apache/commons/numbers/fraction/Fraction.java
@@ -394,6 +394,13 @@ public final class Fraction
             new Fraction(-numerator, denominator);
     }
 
+    /**
+     * {@inheritDoc}
+     * 
+     * <p>Raises an exception if the fraction is equal to zero.
+     * 
+     * @throws ArithmeticException if the current numerator is {@code zero}
+     */
     @Override
     public Fraction reciprocal() {
         return new Fraction(denominator, numerator);


Mime
View raw message