commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <>
Subject [jira] [Resolved] (MATH-1145) Integer overflows MannWhitneyUTest#mannWhitneyU
Date Sat, 13 Sep 2014 15:47:33 GMT


Thomas Neidhart resolved MATH-1145.
       Resolution: Fixed
    Fix Version/s: 3.4

Fixed in r1624756.

Changed the calculation to long as this should be sufficient and is already done like this
in other places.

Thanks for the report and patch!

> Integer overflows MannWhitneyUTest#mannWhitneyU
> -----------------------------------------------
>                 Key: MATH-1145
>                 URL:
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.3, 3.4
>            Reporter: Anders Conbere
>             Fix For: 3.4
> 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).

This message was sent by Atlassian JIRA

View raw message