You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by laimis <gi...@git.apache.org> on 2015/04/19 02:49:49 UTC

[GitHub] lucenenet pull request: detect NaN and return appropriate value

GitHub user laimis opened a pull request:

    https://github.com/apache/lucenenet/pull/129

    detect NaN and return appropriate value

    Lucene.Net versions of FloatToIntBits and DoubleToLongBits are returning incorrect values if the input is NaN. It seems like it returns correct values in all other cases but in NaN returns negative of what it should. Added code to detect if the input is NaN and return the value that matches Lucene version and what is specified in Java docs: 
    
    https://docs.oracle.com/javase/7/docs/api/java/lang/Float.html#floatToIntBits(float)
    https://docs.oracle.com/javase/7/docs/api/java/lang/Double.html#doubleToLongBits(double)
    
    This passes TestNumericRangeQuery32/64 failing tests.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/laimis/lucenenet numericutil_fixes

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucenenet/pull/129.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #129
    
----
commit dedfe73be77d4779a131a01a41425ef7738ec909
Author: Laimonas Simutis <la...@gmail.com>
Date:   2015-04-19T00:46:04Z

    detect NaN and return appropriate value

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] lucenenet pull request: detect NaN and return appropriate value

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/lucenenet/pull/129


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---