You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Christian Semrau (JIRA)" <ji...@apache.org> on 2009/01/21 22:15:59 UTC
[jira] Created: (MATH-243) MathUtils.gcd(Integer.MIN_VALUE, 0)
should throw an Exception instead of returning Integer.MIN_VALUE
MathUtils.gcd(Integer.MIN_VALUE, 0) should throw an Exception instead of returning Integer.MIN_VALUE
----------------------------------------------------------------------------------------------------
Key: MATH-243
URL: https://issues.apache.org/jira/browse/MATH-243
Project: Commons Math
Issue Type: Bug
Reporter: Christian Semrau
Priority: Minor
The gcd method should throw an Exception for gcd(Integer.MIN_VALUE, 0), like for gcd(Integer.MIN_VALUE, Integer.MIN_VALUE). The method should only return nonnegative results.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (MATH-243) MathUtils.gcd(Integer.MIN_VALUE, 0)
should throw an Exception instead of returning Integer.MIN_VALUE
Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MATH-243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Luc Maisonobe resolved MATH-243.
--------------------------------
Resolution: Fixed
Fixed in trunk as of r746511.
Thanks for the patch
> MathUtils.gcd(Integer.MIN_VALUE, 0) should throw an Exception instead of returning Integer.MIN_VALUE
> ----------------------------------------------------------------------------------------------------
>
> Key: MATH-243
> URL: https://issues.apache.org/jira/browse/MATH-243
> Project: Commons Math
> Issue Type: Bug
> Reporter: Christian Semrau
> Priority: Minor
> Attachments: gcdPatch.txt
>
>
> The gcd method should throw an Exception for gcd(Integer.MIN_VALUE, 0), like for gcd(Integer.MIN_VALUE, Integer.MIN_VALUE). The method should only return nonnegative results.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (MATH-243) MathUtils.gcd(Integer.MIN_VALUE, 0)
should throw an Exception instead of returning Integer.MIN_VALUE
Posted by "Christian Semrau (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MATH-243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Semrau updated MATH-243:
----------------------------------
Attachment: gcdPatch.txt
Attached is a patch for gcd, and also for lcm, which failed for some special cases: lcm failed for (0,0) and for (Integer.MIN_VALUE, power of 2).
I also added Javadoc for special cases.
> MathUtils.gcd(Integer.MIN_VALUE, 0) should throw an Exception instead of returning Integer.MIN_VALUE
> ----------------------------------------------------------------------------------------------------
>
> Key: MATH-243
> URL: https://issues.apache.org/jira/browse/MATH-243
> Project: Commons Math
> Issue Type: Bug
> Reporter: Christian Semrau
> Priority: Minor
> Attachments: gcdPatch.txt
>
>
> The gcd method should throw an Exception for gcd(Integer.MIN_VALUE, 0), like for gcd(Integer.MIN_VALUE, Integer.MIN_VALUE). The method should only return nonnegative results.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.