Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6EE87C8A9 for ; Mon, 11 Jun 2012 23:26:11 +0000 (UTC) Received: (qmail 40786 invoked by uid 500); 11 Jun 2012 23:26:10 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 40634 invoked by uid 500); 11 Jun 2012 23:26:10 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 40626 invoked by uid 99); 11 Jun 2012 23:26:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2012 23:26:10 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of thomas.neidhart@gmail.com designates 74.125.82.171 as permitted sender) Received: from [74.125.82.171] (HELO mail-we0-f171.google.com) (74.125.82.171) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2012 23:26:02 +0000 Received: by wejx9 with SMTP id x9so3200505wej.30 for ; Mon, 11 Jun 2012 16:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=xFAdio+zU6uxp6gEzdY1zvYA0S1uJ0mZi28SyXVSGyk=; b=ji1x/fAq833ejEIld+hlrFI6bCG4PjCQEZn76V/6E4xQsg6AIJT4aodEEuofuEqNtu Jzld/cJgjCQVlptORD7hRULiFS9eL9rvBVp3pRTK/j+AK7MjfEFGeR1pfIrr1OfL2gCH rnTUpvsPrHZM7Ux9xlh+zs1EbCIBh5FuROJshSoZZMI7GJSWvSccaIDWYhCGBYM9SeVp J5MWCj3MPTtxDnmPN7bvS2/djf2sCTsXBKC42Hf6oatYT+hkj5Th1fQ852esQWWyU10y D6miO5X7hBI6qq6547/hJPnkw01UjdCb3Bxw+5JhEJxnuI7Y5C4ZyuKv9lvibqecqE5j ogHA== Received: by 10.216.218.219 with SMTP id k69mr6971513wep.123.1339457142716; Mon, 11 Jun 2012 16:25:42 -0700 (PDT) Received: from [192.168.1.2] (ip-213-49-247-14.dsl.scarlet.be. [213.49.247.14]) by mx.google.com with ESMTPS id fm1sm1656256wib.10.2012.06.11.16.25.41 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jun 2012 16:25:41 -0700 (PDT) Message-ID: <4FD67E74.4010308@gmail.com> Date: Tue, 12 Jun 2012 01:25:40 +0200 From: Thomas Neidhart User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Commons Developers List Subject: Re: svn commit: r1348024 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math3/stat/inference/MannWhitneyUTest.java test/java/org/apache/commons/math3/stat/inference/MannWhitneyUTestTest.java References: <20120608110411.E492D238899C@eris.apache.org> In-Reply-To: <20120608110411.E492D238899C@eris.apache.org> X-Enigmail-Version: 1.4.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 06/08/2012 01:04 PM, mikl@apache.org wrote: > Author: mikl > Date: Fri Jun 8 11:04:11 2012 > New Revision: 1348024 > > URL: http://svn.apache.org/viewvc?rev=1348024&view=rev > Log: > MATH-790: Patch applied to fix the overflow issue. > > Modified: > commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/MannWhitneyUTest.java > commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/inference/MannWhitneyUTestTest.java > > Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/MannWhitneyUTest.java > URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/MannWhitneyUTest.java?rev=1348024&r1=1348023&r2=1348024&view=diff > ============================================================================== > --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/MannWhitneyUTest.java (original) > +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/MannWhitneyUTest.java Fri Jun 8 11:04:11 2012 > @@ -170,11 +170,11 @@ public class MannWhitneyUTest { > final int n2) > throws ConvergenceException, MaxCountExceededException { > > - final int n1n2prod = n1 * n2; > + final double n1n2prod = n1 * n2; > > // http://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U#Normal_approximation > - final double EU = (double) n1n2prod / 2.0; > - final double VarU = (double) (n1n2prod * (n1 + n2 + 1)) / 12.0; > + final double EU = n1n2prod / 2.0; > + final double VarU = n1n2prod * (n1 + n2 + 1) / 12.0; > > final double z = (Umin - EU) / FastMath.sqrt(VarU); just a small thing, but wouldn't it be better to do a long multiplication and convert the result to double? Thomas --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org