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 Sat, 17 Aug 2013 18:34:50 GMT

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

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

    Affects Version/s:     (was: 0.3)
    
> 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
>            Reporter: Martin Desruisseaux
>            Assignee: Martin Desruisseaux
>             Fix For: 0.3
>
>
> When formatting a small angle with {{AngleFormat}}, if the angular value is smaller than
1° in magnitude, 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