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] [Closed] (SIS-120) AngleFormat: Missing minus sign when the degrees field is zero
Date Mon, 02 Dec 2013 03:04:35 GMT

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

Martin Desruisseaux closed SIS-120.
-----------------------------------


> 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 was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message