You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2019/08/08 17:30:38 UTC

[commons-numbers] 15/18: NUMBERS-120: Add unit test for rounding up from subnormal to normal number

This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git

commit 404ff82de649dfa503dcd9c1de87ee4f31431920
Author: Schamschi <he...@gmx.at>
AuthorDate: Thu Jul 4 13:31:53 2019 +0200

    NUMBERS-120: Add unit test for rounding up from subnormal to normal number
---
 .../java/org/apache/commons/numbers/fraction/BigFractionTest.java  | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java
index 1663964..c36aa15 100644
--- a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java
+++ b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java
@@ -238,6 +238,13 @@ public class BigFractionTest {
                 BigInteger.ONE.shiftLeft(52).subtract(BigInteger.valueOf(2)),
                 BigInteger.ONE.shiftLeft(1074)
         );
+
+        //this number is smaller than Double.MIN_NORMAL, but should round up to it
+        assertDoubleValue(
+                Double.MIN_NORMAL,
+                BigInteger.ONE.shiftLeft(53).subtract(BigInteger.ONE),
+                BigInteger.ONE.shiftLeft(1075)
+        );
     }
 
     @Test