-
-
Notifications
You must be signed in to change notification settings - Fork 45.6k
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
Removed redundant greatest_common_divisor code #9358
Conversation
…ted the method from Maths folder
…ted the method from Maths folder, also fixed comments
for more information, see https://pre-commit.ci
…ted the method from Maths folder, also fixed comments
It says organize imports. Don't know what to do about that. Otherwise there are no issues |
@Siddikpatel Please run |
Fixed the import issues! |
I just remembered that the Python |
BTW, @Siddikpatel, there are even more duplicate implementations of gcd if you search for "gcd" in the repo (for example, in |
and, what about those files that imports gcd from math module of python? |
Those are fine—it's fine to import functions as helper functions as long as it doesn't include the core of the actual algorithm |
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.
Looks good, but the merge conflict will need to be fixed. I can't fix it myself because I don't have write permission, so could you fix it?
Head branch was pushed to by a user without write access
Ok I am confused now.. It says merge conflicts in |
OK, I see what happened: a previous PR moved |
Yup, it is fixed now. |
It says the file was deleted... did you not move it into the maths module? |
@tianyizheng02 @cclauss A couple of days ago |
No, there shouldn't be any problems. This PR has already been merged so it can't be "deleted" anyway. For your other PR, GitHub will merge it into the updated codebase, the one with this PR already merged. |
* Deleted greatest_common_divisor def from many files and instead imported the method from Maths folder * Deleted greatest_common_divisor def from many files and instead imported the method from Maths folder, also fixed comments * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Deleted greatest_common_divisor def from many files and instead imported the method from Maths folder, also fixed comments * Imports organized * recursive gcd function implementation rolledback * more gcd duplicates removed * more gcd duplicates removed * Update maths/carmichael_number.py * updated files * moved a file to another location --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Describe your change:
Previously all the files that needed greatest_common_divisor (aka gcd), used to define the method instead of just importing from Maths directory's greatest_common_divisor.py file. I removed thos definitions and imported gcd method from Maths folder. Fixes #8098
Checklist: