Return-Path: X-Original-To: apmail-sis-commits-archive@www.apache.org Delivered-To: apmail-sis-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D2AB11015A for ; Wed, 23 Oct 2013 15:28:49 +0000 (UTC) Received: (qmail 99143 invoked by uid 500); 23 Oct 2013 15:28:49 -0000 Delivered-To: apmail-sis-commits-archive@sis.apache.org Received: (qmail 99106 invoked by uid 500); 23 Oct 2013 15:28:48 -0000 Mailing-List: contact commits-help@sis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sis-dev@sis.apache.org Delivered-To: mailing list commits@sis.apache.org Received: (qmail 99099 invoked by uid 99); 23 Oct 2013 15:28:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Oct 2013 15:28:47 +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; Wed, 23 Oct 2013 15:28:45 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4284923888D7; Wed, 23 Oct 2013 15:28:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1535062 - /sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java Date: Wed, 23 Oct 2013 15:28:23 -0000 To: commits@sis.apache.org From: desruisseaux@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131023152823.4284923888D7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: desruisseaux Date: Wed Oct 23 15:28:22 2013 New Revision: 1535062 URL: http://svn.apache.org/r1535062 Log: More conservative fix for rounding errors: round to exactly the number of digits to be formatted, no more. Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java?rev=1535062&r1=1535061&r2=1535062&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java [UTF-8] Wed Oct 23 15:28:22 2013 @@ -922,9 +922,9 @@ public class AngleFormat extends Format * 2 to base 10. */ final int n = fractionDigitsForDelta(Math.ulp(angle) * (secondsFieldWidth == 0 ? 60 : 3600), false); - final double p = pow10(Math.max(1, Math.min(maximumFractionDigits, n))); maximumFractionDigits = Math.max(minimumFractionDigits, Math.min(maximumFractionDigits, n - 1)); + final double p = pow10(maximumFractionDigits); if (secondsFieldWidth != 0) { seconds = (minutes - (minutes = truncate(minutes))) * 60; seconds = rint(seconds * p) / p; // Correction for rounding errors.