-
Notifications
You must be signed in to change notification settings - Fork 26
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
base: main
Are you sure you want to change the base?
Conversation
My implementation which i did during my work.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Function parameter 'passed' should be passed by const reference.
value = passed;//if positive store as it's | ||
} | ||
} | ||
Integer(string passed, int Sign) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Function parameter 'passed' should be passed by const reference.
wheel ++; | ||
current = subtract(current, b); | ||
} | ||
result += (char)(wheel + '0'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Variable 'result' is assigned a value that is never used.
for (char ch: a) { | ||
current = (current << 1) + (current << 3) + ch - '0'; | ||
if (current >= b) { | ||
result += (char)(current / b + '0'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Variable 'result' is assigned a value that is never used.
|
||
|
||
string _modulo(string a, string b) { // modulo operation of two integers(strings) | ||
string result = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Variable 'result' is assigned a value that is never used.
|
||
|
||
|
||
string _modulo(string a, string b) { // modulo operation of two integers(strings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Function parameter 'b' should be passed by const reference.
} | ||
} | ||
|
||
void operator *= (Integer multiplier) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Function parameter 'multiplier' should be passed by const reference.
//Default Empty Constructor::Dont use delegation... | ||
} | ||
//positive - negative value separator | ||
Integer(string passed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Class 'Integer' has a constructor with 1 argument that is not explicit.
} | ||
} | ||
Integer(string passed, int Sign) { | ||
value = passed; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Function parameter 'passed' should be passed by const reference.
} | ||
} | ||
|
||
void operator %= (Integer dividend) { // modulo operator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Function parameter 'dividend' should be passed by const reference.
return to_string(current); | ||
} | ||
|
||
string modulo(string a, string b) { // Day 5: modulo of two integers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Function parameter 'a' should be passed by const reference.
} | ||
|
||
//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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Class 'Integer' has a constructor with 1 argument that is not explicit.
My implementation which i did during my work. Hope this will help.