[SERVER-68364] [CQF] Comparison between doubles and NumberDecimals returns incorrect results Created: 27/Jul/22  Updated: 29/Oct/23  Resolved: 07/Oct/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Emily Wang (Inactive) Assignee: Hana Pearlman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 06/Oct/22 ]

Author:

{'name': 'Hana Pearlman', 'email': 'hana.pearlman@mongodb.com', 'username': 'HanaPearlman'}

Message: SERVER-68364: Enable index_decimal test in cqf passthrough
Branch: master
https://github.com/mongodb/mongo/commit/379528beaac001de2253cb106ba57554f672f758

Generated at Thu Feb 08 06:10:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.