sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Desruisseaux (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SIS-120) AngleFormat: Missing minus sign when the degrees field is zero
Date Tue, 13 Aug 2013 20:12:49 GMT

     [ https://issues.apache.org/jira/browse/SIS-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Martin Desruisseaux updated SIS-120:
------------------------------------

    Description: 
When formatting a small angle with {{AngleFormat}}, if the angular value is smaller than 1°,
then the minus sign is missing. For example formatting -0.1° currently produces {{0°06′}}
while we expect {{-0°06′}}.

The problem appear in the following line:

{code:java}
degrees += correction;
{code}

The problem is that in the Java language, {{-0.0 + 0 == +0.0}}. The fix is to explicitly check
for zero value.

{code:java}
if (correction != 0) {
    // Really need the check for 0 value in order to preserve the sign of negative zero.
    degrees += correction;
}
{code}


  was:
When formatting a small angle with {{AngleFormat}}, if the angular value is smaller than 1°,
then the minus sign is missing. For example formatting 0.1° currently produces {{0°06′}}
while we expect {{-0°06′}}.

The problem appear in the following line:

{code:java}
degrees += correction;
{code}

The problem is that in the Java language, {{-0.0 + 0 == +0.0}}. The fix is to explicitly check
for zero value.

{code:java}
if (correction != 0) {
    // Really need the check for 0 value in order to preserve the sign of negative zero.
    degrees += correction;
}
{code}


    
> AngleFormat: Missing minus sign when the degrees field is zero
> --------------------------------------------------------------
>
>                 Key: SIS-120
>                 URL: https://issues.apache.org/jira/browse/SIS-120
>             Project: Spatial Information Systems
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 0.3
>            Reporter: Martin Desruisseaux
>            Assignee: Martin Desruisseaux
>             Fix For: 0.4
>
>
> When formatting a small angle with {{AngleFormat}}, if the angular value is smaller than
1°, then the minus sign is missing. For example formatting -0.1° currently produces {{0°06′}}
while we expect {{-0°06′}}.
> The problem appear in the following line:
> {code:java}
> degrees += correction;
> {code}
> The problem is that in the Java language, {{-0.0 + 0 == +0.0}}. The fix is to explicitly
check for zero value.
> {code:java}
> if (correction != 0) {
>     // Really need the check for 0 value in order to preserve the sign of negative zero.
>     degrees += correction;
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message