[COMPASS-3659] decimal128: should implement PartialOrd Trait Created: 22/May/19  Updated: 24/May/19  Resolved: 24/May/19

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Irina Shestak (Inactive) Assignee: Irina Shestak (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: COMPASS-3418
Story Points: 5
Sprint: Iteration Echidna

 Description   

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))
}
}


Generated at Wed Feb 07 22:33:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.