Skip to content

Broken Eq/Ord semantics for AssetCapacity #1162

@alexdewar

Description

@alexdewar

AssetCapacity derives PartialEq (float == semantics) but implements Ord using total_cmp, and also declares Eq. This violates the required consistency between Eq/Ord and equality (e.g., 0.0 == -0.0 but total_cmp orders them differently; NaN also breaks reflexivity). Consider implementing PartialEq/Eq manually to align with total_cmp (or drop Ord/Eq if total ordering isn’t required).

Originally posted by @Copilot in #1158 (comment)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions