-
Notifications
You must be signed in to change notification settings - Fork 27
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
add compose_mod and powmod with large exp #174
add compose_mod and powmod with large exp #174
Conversation
075e9e3
to
99b91fb
Compare
cdef nmod_poly res | ||
|
||
if e < 0: | ||
raise ValueError("Exponent must be non-negative") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to use inverse_mod
here?
Or maybe the caller should just do that if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good question. I don't think we invert where e is negative elsewhere, but this is a reasonable thing to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inverting does bring additional complications though because I think then we need the modulus to be irreducible.
a2f80ba
to
4495a4c
Compare
4495a4c
to
e0312f8
Compare
Hopefully addressed the above comments |
Yep, looks good. Thanks |
this PR adds two features which i need for a current project:
I'm a little rusty as I haven't thought about flint for a while, and there's one TODO for the
__pow__
test as now fmpz_mod_poly does not raise an assertion error when a modulus is given generically