-
Notifications
You must be signed in to change notification settings - Fork 191
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
BigUint extended_gcd panics on underflow #253
Comments
We really should have just required
Using what modulus? |
quick fix retracted :p |
Any news on this? It is still an issue, see another playground example. |
It's a bad API to have allowed |
Makes sense. However, I would prefer not to have to convert between BigUint and BigInt back and forth. I simply want to compute the modular inverse of a BigUint, modulo a BigUint. Is there a better way to do it than convert to BigInt, call |
You could wrap |
OK, sounds like a decent workaround. Thanks! (With regards to the conversions: My concern there wasn't performance, but rather code readability.) |
repro: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b18dc13a3c981c6351d3cdd6e24a8715
One quick fix for this would be to override the trait default, cast to signed, and then make sure the coefficients are the positive form after (e.g., by taking the mod), if it is difficult to make the generalized algorithm work.
The text was updated successfully, but these errors were encountered: