Skip to content

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

Open
punitsharma077 wants to merge 1 commit into
ayaankhan98:mainfrom
punitsharma077:main
Open

==,>>,*=,<=,>,== and some other operators#36
punitsharma077 wants to merge 1 commit into
ayaankhan98:mainfrom
punitsharma077:main

Conversation

@punitsharma077
Copy link
Copy Markdown

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

My implementation which i did during my work.
Copy link
Copy Markdown
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

Comment thread Big_Integer/main.cpp
return false;
}

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

Choose a reason for hiding this comment

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

Comment thread Big_Integer/main.cpp
value = passed;//if positive store as it's
}
}
Integer(string passed, int Sign) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Comment thread Big_Integer/main.cpp
wheel ++;
current = subtract(current, b);
}
result += (char)(wheel + '0');
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Comment thread Big_Integer/main.cpp
for (char ch: a) {
current = (current << 1) + (current << 3) + ch - '0';
if (current >= b) {
result += (char)(current / b + '0');
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Comment thread Big_Integer/main.cpp


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

Choose a reason for hiding this comment

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

Comment thread Big_Integer/main.cpp



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

Choose a reason for hiding this comment

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

Comment thread Big_Integer/main.cpp
}
}

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

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

Comment thread Big_Integer/main.cpp
}
}
Integer(string passed, int Sign) {
value = passed;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Comment thread Big_Integer/main.cpp
return *this == passed || *this < passed;
}

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

Choose a reason for hiding this comment

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

Comment thread Big_Integer/main.cpp
}
}

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

Choose a reason for hiding this comment

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

Comment thread Big_Integer/main.cpp
return to_string(current);
}

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

Choose a reason for hiding this comment

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

Comment thread Big_Integer/main.cpp
}

//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
Copy Markdown
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