mirror of
https://github.com/apache/commons-math.git
synced 2025-02-08 02:59:36 +00:00
MATH-790: Patch applied to fix the second overflow issue.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1349372 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
069590396c
commit
07d05a070c
@ -170,7 +170,10 @@ public class MannWhitneyUTest {
|
||||
final int n2)
|
||||
throws ConvergenceException, MaxCountExceededException {
|
||||
|
||||
final double n1n2prod = n1 * n2;
|
||||
/* long multiplication to avoid overflow (double not used due to efficiency
|
||||
* and to avoid precision loss)
|
||||
*/
|
||||
final long n1n2prod = (long) n1 * n2;
|
||||
|
||||
// http://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U#Normal_approximation
|
||||
final double EU = n1n2prod / 2.0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user