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
passing a generator to gcd() fails #32314
Comments
comment:2
It seems this if seq.universe() is ZZ:
- return GCD_list(a)
+ return GCD_list(seq)
else:
return __GCD_sequence(seq, **kwargs) is enough to fix the bug, and enforcing the type in |
comment:3
You're right. I moved the |
comment:4
Replying to @yyyyx4:
I prefer it because of the performance degradation. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
Done. |
This comment has been minimized.
This comment has been minimized.
comment:8
LGTM |
Reviewer: Kwankyu Lee |
comment:9
what about the necessary new doctest ? |
comment:10
Replying to @fchapoton:
Feel free to set it back to needs work if you think a doctest is required. |
Changed branch from public/fix_gcd_on_generators to |
The following use of
gcd()
fails:At the same time,
lcm()
works fine with generators:The proposed fix is to make sure we consume the generator only once in
gcd()
and pass it toGCD_list()
as a list.Component: basic arithmetic
Keywords: gcd, generator, list
Author: Lorenz Panny
Branch/Commit:
e6a3c5d
Reviewer: Kwankyu Lee
Issue created by migration from https://trac.sagemath.org/ticket/32314
The text was updated successfully, but these errors were encountered: