You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Anders Conbere (JIRA)" <ji...@apache.org> on 2014/08/11 20:34:12 UTC
[jira] [Created] (MATH-1145) Integer overflows
MannWhitneyUTest#mannWhitneyU
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)