[CSHARP-338] BsonDouble.Equals fails on NaN Created: 11/Oct/11  Updated: 02/Apr/15  Resolved: 13/Oct/11

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.2
Fix Version/s: 1.3

Type: Bug Priority: Minor - P4
Reporter: Yaniv Schiller Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CSHARP-339 Check all implementations of Equals, ... Closed

 Description   

BsonDouble doesn't follow double's convention on Equals.

Implementation of BsonDouble.Equals call double's == operator.
think it should call double's Equal method

var left = double.NaN;
var right = double.NaN;
var bsonLeft = BsonDouble.Create(left);
var bsonRight = BsonDouble.Create(right);
left.Equals(right).Dump("left = right"); //return true
bsonLeft.Equals(bsonRight).Dump("left = right"); //returns false



 Comments   
Comment by Robert Stam [ 12/Oct/11 ]

Replacing this with the more general JIRA ticket to check all implementations of Equals, operator == and GetHashCode.

Generated at Wed Feb 07 21:36:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.