Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-338

BsonDouble.Equals fails on NaN

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.3
    • Affects Version/s: 1.2
    • Component/s: None
    • Labels:
      None

      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

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            yschiller Yaniv Schiller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: