Skip to content
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

Added GCD with tests #15

Merged
merged 7 commits into from
Jan 5, 2018
Merged

Added GCD with tests #15

merged 7 commits into from
Jan 5, 2018

Conversation

anandsit043
Copy link
Contributor

@anandsit043 anandsit043 commented Jan 3, 2018

Added test cases in math.test.cpp and corrected the friend function part as per PR review.

Relates to #5.

@codecov
Copy link

codecov bot commented Jan 3, 2018

Codecov Report

Merging #15 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #15   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines         473    492   +19     
=====================================
+ Hits          473    492   +19
Impacted Files Coverage Δ
include/functions/math.hpp 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 38ba375...f9af689. Read the comment docs.

@anandsit043 anandsit043 changed the title Added Test cases and modified definition GCD: Added Test cases and modified definition Jan 3, 2018
@faheel faheel added the functions: math Math functions label Jan 3, 2018
@faheel faheel changed the title GCD: Added Test cases and modified definition Added GCD with tests Jan 3, 2018
Copy link
Owner

@faheel faheel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes are required, after which it'll be good to merge 👍

@@ -93,7 +93,7 @@ class BigInt {
// I/O stream operators:
friend std::istream& operator>>(std::istream&, BigInt&);
friend std::ostream& operator<<(std::ostream&, const BigInt&);

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the extra spaces so that this file's history isn't affected.

@@ -528,4 +528,6 @@ BigInt operator%(const std::string& lhs, const BigInt& rhs) {
return BigInt(lhs) % rhs;
}



Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the extra lines so that this file's history isn't affected.

/*
Logic for handling negative case:

gcd{a,b}=gcd{|a|,b}=gcd{a,|b|}=gcd{|a|,|b|}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is well-known information and I don't think it needs to be described here.

@anandsit043
Copy link
Contributor Author

Hi @faheel,
Done with all the mentioned changes.

@faheel
Copy link
Owner

faheel commented Jan 4, 2018

There's still one left. Check the review above.

@anandsit043
Copy link
Contributor Author

Does it look good now? I will get started on LCM.

@faheel
Copy link
Owner

faheel commented Jan 5, 2018

Yes, it does. Thank you!

@faheel faheel merged commit b218f44 into faheel:master Jan 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
functions: math Math functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants