-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
FiniteField: make GF(p,n) the same as GF(p^n) #38589
base: develop
Are you sure you want to change the base?
Conversation
Documentation preview for this PR (built with commit c46444d; changes) is ready! 🎉 |
Actually I'm more in favour of treating |
I tend to agree but the (serious) drawback is an extra type checking and hence more time needed to construct the object |
Timing data:
9.54 μs versus 264 μs. So around 3-4% increase if the field is already cached. Is it that bad? (On the other hand, small changes pile up…?) On the other hand that might break some backwards compatibility in unexpected cases e.g. the (actual) |
8c0a247
to
9e07cd1
Compare
I modify the code to make GF(p, n) = GF((p, n)). Thoughts? |
It is not uncommon for the user to accidentally call
GF(p,n)
while they want to callGF(p^n)
orGF(p^n)
.This raises an error when the user try to do so. Suggested by @videlec in #38376 (comment) .
(Actually if backwards compatibility isn't that important we can just make this equivalent to
GF((p,n))
. I doubt any existing code specifically relies onGF(p,n)
called this way withn
an integer.)📝 Checklist
⌛ Dependencies