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

BsonDouble.Equals fails on NaN

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.3
    • 1.2
    • None
    • None

    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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: