-
Notifications
You must be signed in to change notification settings - Fork 363
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
Migrate greatest common denominator algorithm #201
Conversation
Importing std namespace can lead to namespace pollution. This commit replaces those namespace directives with the specific commands required, such as "using std::cin".
Refactor greatest common denominator algorithm to use a header file. Add test cases as .cpp file to test. Also fix an error in greatest common denominator function that prevented the accurate calculation of negative arguments. Update README.
Edit: On second look, that other algorithm is doing something different. So maybe |
The unit test file for greatest_common_denominator was included twice. This fixes that mistake.
I haven't heard/read about greatest common "denominator" before. "Divisor" is the commonly used term for a number that divides another number. So we should stick to it. From Wikipedia, other common terms used for GCD are:
|
Works for me, and shorter too. Will update and commit right now. |
Migrate greatest common denominator algorithm to header file (as described in #163).