commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luc Maisonobe (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (MATH-238) MathUtils.gcd(u, v) fails when u and v both contain a high power of 2
Date Fri, 16 Jan 2009 23:07:59 GMT

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

Luc Maisonobe resolved MATH-238.
--------------------------------

    Resolution: Fixed

fixed in trunk as of r73517

thanks for the report

> MathUtils.gcd(u, v) fails when u and v both contain a high power of 2
> ---------------------------------------------------------------------
>
>                 Key: MATH-238
>                 URL: https://issues.apache.org/jira/browse/MATH-238
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Christian Semrau
>            Priority: Minor
>
> The test at the beginning of MathUtils.gcd(u, v) for arguments equal to zero fails when
u and v contain high enough powers of 2 so that their product overflows to zero.
>         assertEquals(3 * (1<<15), MathUtils.gcd(3 * (1<<20), 9 * (1<<15)));
> Fix: Replace the test at the start of MathUtils.gcd()
>         if (u * v == 0) {
> by
>         if (u == 0 || v == 0) {

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


Mime
View raw message