Skip to content

Make Ord and Hash iterative to avoid stack overflow#156

Open
cuviper wants to merge 1 commit into
rust-num:mainfrom
cuviper:cmp-loop
Open

Make Ord and Hash iterative to avoid stack overflow#156
cuviper wants to merge 1 commit into
rust-num:mainfrom
cuviper:cmp-loop

Conversation

@cuviper

@cuviper cuviper commented Jul 8, 2026

Copy link
Copy Markdown
Member

Converts the recursive continued-fraction algorithms in Ord::cmp and
Hash::hash for Ratio<T> to iterative loops, preventing stack overflow
when comparing or hashing ratios with very large numerators/denominators.

Fixes #140

Converts the recursive continued-fraction algorithms in `Ord::cmp` and
`Hash::hash` for `Ratio<T>` to iterative loops, preventing stack overflow
when comparing or hashing ratios with very large numerators/denominators.

Fixes rust-num#140
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.

Stackoverflow with PartialEq and PartialOrd

1 participant