XenoAmess commented on a change in pull request #83:
URL: https://github.com/apache/commons-numbers/pull/83#discussion_r476716205



##########
File path: 
commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/FractionTest.java
##########
@@ -622,6 +622,16 @@ void testMath1261() {
         assertFraction(1, Integer.MAX_VALUE, b.divide(2));
     }
 
+    @Test
+    void testNumbers150() {
+        // zero to negative powers should throw an exception
+        Assertions.assertThrows(ArithmeticException.class, () -> 
Fraction.ZERO.pow(-1));
+        Assertions.assertThrows(ArithmeticException.class, () -> 
Fraction.ZERO.pow(Integer.MIN_VALUE));
+
+        // shall overflow
+        Assertions.assertThrows(ArithmeticException.class, () -> 
Fraction.of(2).pow(Integer.MIN_VALUE));

Review comment:
       @aherbert done.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to