commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anders Conbere (JIRA)" <j...@apache.org>
Subject [jira] [Created] (MATH-1145) Integer overflows MannWhitneyUTest#mannWhitneyU
Date Mon, 11 Aug 2014 18:34:12 GMT
Anders Conbere created MATH-1145:
------------------------------------

             Summary: Integer overflows MannWhitneyUTest#mannWhitneyU
                 Key: MATH-1145
                 URL: https://issues.apache.org/jira/browse/MATH-1145
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 3.3, 3.4
            Reporter: Anders Conbere


In the calculation of MannWhitneyUTest#mannWhitneyU there are two instances where the lengths
of the input arrays are multiplied together. Because Array#length is an integer this means
that the effective maximum size of your dataset until reaching overflow is Math.sqrt(Integer.MAX_VALUE).

The following is a link to a diff, with a test the exposes the issue, and a fix (casting lengths
up into doubles before multiplying).

https://gist.github.com/aconbere/4fef56e5182e510aceb3



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message