Skip to content

Fix/decimal ord eq contract - #126

Merged
dnsl48 merged 3 commits into
masterfrom
fix/decimal-ord-eq-contract
Aug 9, 2026
Merged

Fix/decimal ord eq contract#126
dnsl48 merged 3 commits into
masterfrom
fix/decimal-ord-eq-contract

Conversation

@dnsl48

@dnsl48 dnsl48 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

No description provided.

dnsl48 added 3 commits August 9, 2026 14:14
Implemented a single canonical decimal comparator so two decimals compare equal if and only if Ord returns Equal. This keeps finite ordering, equality, and hashing consistent with each value having its own precision, including canonical zero and trailing-zero handling, and preserves ordered and hashed collection behaviour.
Added permanent Criterion cases for decimal comparison: integer early exit, canonical equal pair, same exact value across precision, negative canonical zero handling, and long common-prefix workloads at p1, p16, and p255. This keeps comparison behaviour visible in regressions without changing normal arithmetic semantics.
Documented decimal ordering and equality in terms of each value precision and the zero-trimming convention used before comparison so trailing zeroes do not affect equality. README and changelog now also describe Ord, PartialOrd, Eq and Hash behaviour and clarify ordered and hashed collection compatibility.
@dnsl48
dnsl48 merged commit 97fe8f4 into master Aug 9, 2026
8 checks passed
@dnsl48
dnsl48 deleted the fix/decimal-ord-eq-contract branch August 9, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant