Improve relevant unit test to also check denominator
@@ -32,6 +32,11 @@ public class BigFractionTest {
Assertions.assertEquals(BigInteger.valueOf(expectedDenominator), actual.getDenominator());
}
+ private void assertFraction(BigInteger expectedNumerator, BigInteger expectedDenominator, BigFraction actual) {
+ Assertions.assertEquals(expectedNumerator, actual.getNumerator());
+ Assertions.assertEquals(expectedDenominator, actual.getDenominator());
+ }
+
@Test
public void testConstructor() {
for (CommonTestCases.UnaryOperatorTestCase testCase : CommonTestCases.numDenConstructorTestCases()) {
@@ -266,7 +271,7 @@ public class BigFractionTest {
}
Assertions.assertEquals(1l, BigFraction.from(Double.MAX_VALUE).getDenominatorAsLong());
Assertions.assertEquals(1l, BigFraction.from(Double.longBitsToDouble(0x0010000000000000L)).getNumeratorAsLong());
- Assertions.assertEquals(1l, BigFraction.from(Double.MIN_VALUE).getNumeratorAsLong());
+ assertFraction(BigInteger.ONE, BigInteger.ONE.shiftLeft(1074), BigFraction.from(Double.MIN_VALUE));
}
@Test
