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

==,>>,*=,<=,>,== and some other operators #36

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

punitsharma077
Copy link

My implementation which i did during my work. Hope this will help.

My implementation which i did during my work.
Copy link
Owner

Codacy Here is an overview of what got changed by this pull request:

Issues
======
- Added 13
           

Clones added
============
- Big_Integer/main.cpp  2
         

See the complete overview on Codacy

return false;
}

bool operator <= (Integer passed) { // less or equal operator
Copy link
Owner

Choose a reason for hiding this comment

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

value = passed;//if positive store as it's
}
}
Integer(string passed, int Sign) {
Copy link
Owner

Choose a reason for hiding this comment

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

wheel ++;
current = subtract(current, b);
}
result += (char)(wheel + '0');
Copy link
Owner

Choose a reason for hiding this comment

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

for (char ch: a) {
current = (current << 1) + (current << 3) + ch - '0';
if (current >= b) {
result += (char)(current / b + '0');
Copy link
Owner

Choose a reason for hiding this comment

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



string _modulo(string a, string b) { // modulo operation of two integers(strings)
string result = "";
Copy link
Owner

Choose a reason for hiding this comment

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




string _modulo(string a, string b) { // modulo operation of two integers(strings)
Copy link
Owner

Choose a reason for hiding this comment

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

}
}

void operator *= (Integer multiplier) {
Copy link
Owner

Choose a reason for hiding this comment

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

//Default Empty Constructor::Dont use delegation...
}
//positive - negative value separator
Integer(string passed) {
Copy link
Owner

Choose a reason for hiding this comment

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

}
}
Integer(string passed, int Sign) {
value = passed;
Copy link
Owner

Choose a reason for hiding this comment

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

return *this == passed || *this < passed;
}

bool operator > (Integer passed) { // greater operator
Copy link
Owner

Choose a reason for hiding this comment

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

}
}

void operator %= (Integer dividend) { // modulo operator
Copy link
Owner

Choose a reason for hiding this comment

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

return to_string(current);
}

string modulo(string a, string b) { // Day 5: modulo of two integers
Copy link
Owner

Choose a reason for hiding this comment

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

}

//Day 4: if integer range numbers are passed then only will work fine.....preferably pass string values..
Integer(int passed) { //Remember Remove this as we will be passing string as a parameter
Copy link
Owner

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants