-
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
[feat] operator overloads #4
Comments
what we have to do with these operators?Please Explain |
@Tripathi-Alok suppose we decalre two large integers like
then in order to take input of these large integers we need to overload the insertion and excertion operators on the largeInt class then only we can write the statement like
if we do not overload the istream and ostream operators (insertion and excertion operators) then this will create an error. simlar goes for the other operators like addition, subtraction, etc etc.
then c++ compiler does not know how to add or subtract these large integers thus, we have to define the routine to tell the compiler how to handle these operations of addition or subraction thus we need to overload the operators on the largeInt class. hope this makes sense. |
Okay can i try on this issue? |
I'll try my best but not sure that i can achieve the goal for this question |
yes sure go ahead! @Alok-873 please mark the operators on which you are working, it will be easy for others to take up. |
Minimum how many operators we can take |
@Tripathi-Alok you can implement all if you wish. |
I would like to work on + - operators |
@Tripathi-Alok okay go ahead, looking forward for you PR |
Sir why Am i getting error regarding Cpmake.txt file? |
@Tripathi-Alok CMake is a tool used for building the projects, as large projects contains of large number of files so it's not possible to compile each and every file separately into object code and then link them, so we hand over this job to cmake, we specify the CMake configuration in files known as you can read more about it here |
All the overloads and ctors can take both long long and int64_t as parameters. This won't compile on some platforms where int64_t happens to be a typedef for long long int (for example it doesn't compile on my Windows 10 machine using MinGW-W64 g++ 8.1.0). We should only use long long or int64_t (but long long would be simpler). I'll fix this (I also made some changes in the ostream operator and wrote ctors) |
I am working on < operator |
@ayaankhan98 |
I have previously written code for multiplying signed long numeric integer strings, would like to contribute to the multiply '*' operator? |
you must have gcc and cmake installed on your system after installing this you will be able to build the code on your system |
I finished the == operator overload in PR #16 in order to write ctor tests. Everything works perfectly fine! |
I would like to work on * operator. Will Karatsuba algorithm for multiplication be fine for this library? |
@yashsoni501 yes, go ahead! |
Should implicit casting operators be also on this list. This will allow following use case. Plus this will probably reduce the number of overloaded of other operators too. |
yes, please create issue for this. |
My bad. This operator is already implemented. Good that I didn't create a new issue for this. |
+ overload
- overload
* overload
/ overload
+= overload
-= overload
*= overload
/= overload
% overload
%= overload
== overload
= overload
!= overload
< overload
<= overload
> overload
>= overload
also include tests for corrosponding operators
The text was updated successfully, but these errors were encountered: