Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-68364

[CQF] Comparison between doubles and NumberDecimals returns incorrect results

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible

      Comes from this CQF pass through test.
      Querying for a number less than decimal 0.3 should return the double 0.3, because a double 0.3 is actually 0.2999999999999999888. So,

      t.insert({y: 0.3})t.find({y: {$lt: NumberDecimal('0.3')}})
      

      Should return

      {y: 0.3}
      

      This is not a type bracketing issue.

            Assignee:
            hana.pearlman@mongodb.com Hana Pearlman
            Reporter:
            emily.wang@mongodb.com Emily Wang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: