Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent crash in order_from_multiple() due to rounding error #38490

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

yyyyx4
Copy link
Member

@yyyyx4 yyyyx4 commented Aug 8, 2024

Due to what appears to be rounding errors, the value of k here can be zero, which results in the list L being split as L1 == [] and L2 == L. This causes an error in the next recursive call.

Simple workaround: If either L1 or L2 would end up being empty, we split the lists in the middle instead.

Resolves #38489.

Copy link

github-actions bot commented Aug 8, 2024

Documentation preview for this PR (built with commit 0b172b1; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@yyyyx4 yyyyx4 changed the title fix #38489 prevent crash in order_from_multiple() due to rounding error Aug 8, 2024
@grhkm21
Copy link
Contributor

grhkm21 commented Aug 9, 2024

god.

@grhkm21
Copy link
Contributor

grhkm21 commented Aug 9, 2024

good*

vbraun pushed a commit to vbraun/sage that referenced this pull request Aug 11, 2024
…ing error

Due to what appears to be rounding errors, the value of `k` here can be
zero, which results in the list `L` being split as `L1 == []` and `L2 ==
L`. This causes an error in the next recursive call.

Simple workaround: If either `L1` or `L2` would end up being empty, we
split the lists in the middle instead.

Resolves sagemath#38489.

URL: sagemath#38490
Reported by: Lorenz Panny
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this pull request Aug 27, 2024
…ing error

    
Due to what appears to be rounding errors, the value of `k` here can be
zero, which results in the list `L` being split as `L1 == []` and `L2 ==
L`. This causes an error in the next recursive call.

Simple workaround: If either `L1` or `L2` would end up being empty, we
split the lists in the middle instead.

Resolves sagemath#38489.
    
URL: sagemath#38490
Reported by: Lorenz Panny
Reviewer(s):
@vbraun vbraun merged commit 60f3816 into sagemath:develop Sep 3, 2024
20 of 22 checks passed
@yyyyx4 yyyyx4 deleted the public/38489 branch September 3, 2024 22:52
@mkoeppe mkoeppe added this to the sage-10.5 milestone Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

order_from_multiple() fails for some inputs
4 participants