BsonDouble.Equals fails on NaN

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 1.3
    • Affects Version/s: 1.2
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 Stam
              Reporter:
              Yaniv Schiller
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: