decimal128: should implement PartialOrd Trait

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None

      bson crate requires to have a partial ord trait. This will be very tricky when comparing exponents and significands as numbers like `1x10^3` is equal to `1x10^2`. Good example of comparison logic is in the Java Implementation: https://github.com/mongodb/mongo-csharp-driver/blob/v2.8.1/src/MongoDB.Bson/ObjectModel/Decimal128.cs#L1901

       

      PartialOrd implementation example:
      impl PartialOrd for Person { fn partial_cmp(&self, other: &Person) -> Option<Ordering> { Some(self.cmp(other))
      }
      }

            Assignee:
            Irina Shestak (Inactive)
            Reporter:
            Irina Shestak (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: