Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1931211DDA for ; Sat, 13 Sep 2014 15:47:34 +0000 (UTC) Received: (qmail 33542 invoked by uid 500); 13 Sep 2014 15:47:33 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 33448 invoked by uid 500); 13 Sep 2014 15:47:33 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 33436 invoked by uid 99); 13 Sep 2014 15:47:33 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Sep 2014 15:47:33 +0000 Date: Sat, 13 Sep 2014 15:47:33 +0000 (UTC) From: "Thomas Neidhart (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (MATH-1145) Integer overflows MannWhitneyUTest#mannWhitneyU MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MATH-1145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] 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: https://issues.apache.org/jira/browse/MATH-1145 > 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). > https://gist.github.com/aconbere/4fef56e5182e510aceb3 -- This message was sent by Atlassian JIRA (v6.3.4#6332)