You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2011/01/17 05:14:44 UTC

[jira] Closed: (LANG-663) org.apache.commons.lang3.math.Fraction does not always succeed in multiplyBy and divideBy

     [ https://issues.apache.org/jira/browse/LANG-663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-663.
------------------------------

    Resolution: Fixed

svn ci -m "Adding note that this has overflow issues and pointing to BigFraction" src/main/java/org/apache/commons/lang3/math/Fraction.java 
Sending        src/main/java/org/apache/commons/lang3/math/Fraction.java
Transmitting file data .
Committed revision 1059747.


> org.apache.commons.lang3.math.Fraction does not always succeed in multiplyBy and divideBy
> -----------------------------------------------------------------------------------------
>
>                 Key: LANG-663
>                 URL: https://issues.apache.org/jira/browse/LANG-663
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.math.*
>    Affects Versions: 3.0
>            Reporter: Christian Semrau
>            Priority: Minor
>             Fix For: 3.0
>
>
> The Fraction.multiplyBy and divideBy methods fail sometimes when the arguments are not reduced.
> {code:title=FunctionTest.java|borderStyle=solid}
>     public void testMultiply() {
>         // ...
>         f1 = Fraction.getFraction(Integer.MAX_VALUE, Integer.MAX_VALUE);
>         f2 = Fraction.getFraction(42, 1);
>         f = f1.multiplyBy(f2);
>         assertEquals(42, f.getNumerator());
>         assertEquals(1, f.getDenominator());
>     public void testDivide() {
>         // ...
>         f1 = Fraction.getFraction(Integer.MAX_VALUE, Integer.MAX_VALUE);
>         f2 = Fraction.getFraction(42, 1);
>         f = f1.divideBy(f2);
>         assertEquals(1, f.getNumerator());
>         assertEquals(42, f.getDenominator());
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.