Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16361

'mod' function query casts to float, returns wrong modulus for large ints

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 9.0
    • 9.1, main (10.0)
    • search
    • None

    Description

      mod function query uses DualFloatFunction. This eventualy does a conversion

       (float)value 

      converting an integer (32bit) into a float which has a 24bit mantissa ,resulting in a loss of precision.

      This means that for integers > 2^24 this returns an incorrect modulus due to this loss of precision.

      Should we use integer only, or perhaps cast to double (so then create a DualDoubleFunction) which has a 52bit mantissa, so can convert int to double without loss of precision?

      This issue may also affect the other function queries?

       

      Attachments

        Issue Links

          Activity

            People

              epugh Eric Pugh
              rosher Dan Rosher
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h