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 a copy constructor #8

Merged
merged 1 commit into from
Jun 16, 2016

Conversation

biancama
Copy link
Contributor

Hi I added a copy constructor because to mitigate the side effect all arithmetic operations

@kasparsklavins
Copy link
Owner

kasparsklavins commented Jun 15, 2016

Ignore the failing checks.
What kind of side effects?

@biancama
Copy link
Contributor Author

which failing tests?

basically each time copy the object to return it from a function.

so if I have
Bigint a(10), b, c;
b= a(10);
c = a.pow(2);

then
a = 100 c = 100 but b =10

If I don't have the copy constructor all are 100

normally it's good for this kind of operation having immutability

have a look to
https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html

Always return new object

Massimo

On Wed, Jun 15, 2016 at 12:35 PM, Kaspars notifications@github.com wrote:

Ignore the failing tests.
What kind of side effects?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#8 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAbpKeW1GHloHtsWjfS_S8pQW0qdOm3Vks5qL9VpgaJpZM4I2F1g
.

Massimo Biancalani

@kasparsklavins
Copy link
Owner

These checks.

Thanks for the pull request, will go through it later.

@kasparsklavins kasparsklavins merged commit 1b840c7 into kasparsklavins:master Jun 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants