Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0
-
None
-
None
-
All
Description
When multiplying two BigFraction objects with numerators larger than will fit in an java-primitive int the result of BigFraction.ZERO is incorrectly returned.
Test Case:
BigFraction fractionA = new BigFraction(0.00131);
BigFraction fractionB = new BigFraction(.37).reciprocal();
BigFraction errorResult = fractionA.multiply(fractionB);
System.out.println("Error Result: " + errorResult);
BigFraction correctResult = new BigFraction(fractionA.getNumerator().multiply(fractionB.getNumerator()), fractionA.getDenominator().multiply(fractionB.getDenominator()));
System.out.println("Correct Result: " + correctResult);