Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 68704 invoked from network); 1 Feb 2011 19:35:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Feb 2011 19:35:17 -0000 Received: (qmail 94202 invoked by uid 500); 1 Feb 2011 19:35:16 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 94036 invoked by uid 500); 1 Feb 2011 19:35:16 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 94029 invoked by uid 99); 1 Feb 2011 19:35:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 19:35:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 19:35:15 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 39C4C23889EB; Tue, 1 Feb 2011 19:34:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1066168 - /commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java Date: Tue, 01 Feb 2011 19:34:55 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110201193455.39C4C23889EB@eris.apache.org> Author: sebb Date: Tue Feb 1 19:34:54 2011 New Revision: 1066168 URL: http://svn.apache.org/viewvc?rev=1066168&view=rev Log: Unnecessary casts Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java?rev=1066168&r1=1066167&r2=1066168&view=diff ============================================================================== --- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java (original) +++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java Tue Feb 1 19:34:54 2011 @@ -1345,7 +1345,7 @@ public class FastMath { // y is the most significant 10 bits of the mantissa //double y = Double.longBitsToDouble(bits & 0xfffffc0000000000L); //double epsilon = (x - y) / y; - double epsilon = (double)(bits & 0x3ffffffffffL) / (TWO_POWER_52 + (bits & 0x000ffc0000000000L)); + double epsilon = (bits & 0x3ffffffffffL) / (TWO_POWER_52 + (bits & 0x000ffc0000000000L)); double lnza = 0.0; double lnzb = 0.0; @@ -1359,7 +1359,7 @@ public class FastMath { double xb = ab; /* Need a more accurate epsilon, so adjust the division. */ - double numer = (double)(bits & 0x3ffffffffffL); + double numer = (bits & 0x3ffffffffffL); double denom = TWO_POWER_52 + (bits & 0x000ffc0000000000L); aa = numer - xa*denom - xb * denom; xb += aa / denom; @@ -3708,7 +3708,7 @@ public class FastMath { return x*y; } - return (double) y; + return y; } /** Get the smallest whole number larger than x. @@ -4041,7 +4041,7 @@ public class FastMath { * @return exponent for d in IEEE754 representation, without bias */ public static int getExponent(final float f) { - return (int) ((Float.floatToIntBits(f) >>> 23) & 0xff) - 127; + return ((Float.floatToIntBits(f) >>> 23) & 0xff) - 127; } }