You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Mark Miller (JIRA)" <ji...@apache.org> on 2009/09/07 05:36:57 UTC

[jira] Created: (LUCENE-1895) Point2D defines equals by comparing double types with ==

Point2D defines equals by comparing double types with ==
--------------------------------------------------------

                 Key: LUCENE-1895
                 URL: https://issues.apache.org/jira/browse/LUCENE-1895
             Project: Lucene - Java
          Issue Type: Bug
          Components: contrib/spatial
            Reporter: Mark Miller
            Priority: Trivial


Ideally, this should allow for a margin of error right?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1895) Point2D defines equals by comparing double types with ==

Posted by "Chris Male (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853408#action_12853408 ] 

Chris Male commented on LUCENE-1895:
------------------------------------

As suggested, its best to use an epsilon when comparing doubles, much like junit.

I will work on a patch.

> Point2D defines equals by comparing double types with ==
> --------------------------------------------------------
>
>                 Key: LUCENE-1895
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1895
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>            Reporter: Mark Miller
>            Assignee: Chris Male
>            Priority: Trivial
>
> Ideally, this should allow for a margin of error right?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1895) Point2D defines equals by comparing double types with ==

Posted by "Chris Male (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853400#action_12853400 ] 

Chris Male commented on LUCENE-1895:
------------------------------------

Mark,

Its been over 6 months I know, but do you remember why you suggested this? Was there a particular case you had in mind? 

I'd like to see Point2D (or Point as I'd like it renamed) to be an all purpose class for the spatial work, so it seems comparing the values exactly would be a good idea.

> Point2D defines equals by comparing double types with ==
> --------------------------------------------------------
>
>                 Key: LUCENE-1895
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1895
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>            Reporter: Mark Miller
>            Assignee: Chris Male
>            Priority: Trivial
>
> Ideally, this should allow for a margin of error right?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Assigned: (LUCENE-1895) Point2D defines equals by comparing double types with ==

Posted by "Chris Male (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1895?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Male reassigned LUCENE-1895:
----------------------------------

    Assignee: Chris Male

> Point2D defines equals by comparing double types with ==
> --------------------------------------------------------
>
>                 Key: LUCENE-1895
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1895
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>            Reporter: Mark Miller
>            Assignee: Chris Male
>            Priority: Trivial
>
> Ideally, this should allow for a margin of error right?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1895) Point2D defines equals by comparing double types with ==

Posted by "Chris Male (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853404#action_12853404 ] 

Chris Male commented on LUCENE-1895:
------------------------------------

{quote}
My generic worry is that you can come to the same double value in two different ways, but == will not find them to be equal.
{quote}

How so?

> Point2D defines equals by comparing double types with ==
> --------------------------------------------------------
>
>                 Key: LUCENE-1895
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1895
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>            Reporter: Mark Miller
>            Assignee: Chris Male
>            Priority: Trivial
>
> Ideally, this should allow for a margin of error right?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1895) Point2D defines equals by comparing double types with ==

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853402#action_12853402 ] 

Mark Miller commented on LUCENE-1895:
-------------------------------------

I put this up not knowing really anything about the specific use case(s) of the Point2D class - I have never used Spatial - so close if it makes sense to do so.

My generic worry is that you can come to the *same* double value in two different ways, but == will not find them to be equal.

> Point2D defines equals by comparing double types with ==
> --------------------------------------------------------
>
>                 Key: LUCENE-1895
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1895
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>            Reporter: Mark Miller
>            Assignee: Chris Male
>            Priority: Trivial
>
> Ideally, this should allow for a margin of error right?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org