-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 gcd and lcm for Rational #27039
Comments
Why not |
I can't grasp what you mean. If we define https://en.wikipedia.org/wiki/Least_common_multiple#Formulas |
Since the rationals are a field, the gcd will always be 1 (we can multiply the gcd with units). |
The Wikipedia page describes the gcd and lcm of positive rational integers. This is unrelated. |
OK, I understand. Julia's |
FWIW, I think implementing julia> intersect(1//3:2//3:11//3, 0//1:1//2:4//1) # should be 1//1:2//1:3//1
ERROR: MethodError: no method matching lcm(::Rational{Int64}, ::Rational{Int64}) However, for this to work, one would also need to implement |
See this gcd-stackexchange-2012, specially the last article about extension of
|
IIUC #33910 implemented this. Can someone with the right permissions close the issue? |
There are no functions for
Rational
.The text was updated successfully, but these errors were encountered: