You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Lance Norskog <go...@gmail.com> on 2009/02/24 10:38:14 UTC

Re: [jira] Commented: (SOLR-1019) ConstantScorePrefixQuery.java - Absolute FP comparison on getBoost()

Hey! I was going to file that!

Seriously it's nice to know that separate eyes are zeroing in on problems
this small; it means the bigger ones are gone.

On 2/23/09, Hoss Man (JIRA) <ji...@apache.org> wrote:
>
>
>     [
> https://issues.apache.org/jira/browse/SOLR-1019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676120#action_12676120]
>
> Hoss Man commented on SOLR-1019:
> --------------------------------
>
> bq. The bottom line is that absolute FP comparisons can result in
> unpredictable behaviors, depending on the underlying implementation
> something that we want to avoid.
>
> The behavior of equality operators on floats is fairly explicit and
> unambiguous in JLS s15.21 -- if a JVM implementation produces unexpected
> behavior on these comparisons that's a bug in the JVM implementation.
>
> It's not ConstantScorePrefixQuery's job (or the job of any other Query
> class) to second guess whether the caller considers a boost value of
> X+epsilon to be "close enough" to a boost value of X to consider them the
> same query.
>
> (FWIW: I agree that equality tests on float/double values tend to
> indicate  ... i just disagree with the assessment that there actually is a
> mistake in these specific cases)
>
>
> > ConstantScorePrefixQuery.java - Absolute FP comparison on getBoost()
> > ---------------------------------------------------------------------
> >
> >                 Key: SOLR-1019
> >                 URL: https://issues.apache.org/jira/browse/SOLR-1019
> >             Project: Solr
> >          Issue Type: Bug
> >          Components: clients - java
> >    Affects Versions: 1.3
> >         Environment: Java 6, Tomcat 6
> >            Reporter: Kay Kay
> >         Attachments: SOLR-1019.patch
> >
> >
> > Absolute FP comparisons are inherently unsafe.  Comparisons of FP done
> under an epsilon resolution difference.
> > affects ConstantScorePrefixQuery#toString() and #equals()
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>


-- 
Lance Norskog
goksron@gmail.com
650-922-8831 (US)