Open ayaankhan98 opened 3 years ago
what we have to do with these operators?Please Explain
@Tripathi-Alok suppose we decalre two large integers like
largeInt a, b;
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
cin >> a >> b;
if we do not overload the istream and ostream operators (insertion and excertion operators) then this will create an error. basically for custom types we have to tell the routine to the compiler that in which way the compiler should interpret these operators for custom types.
simlar goes for the other operators like addition, subtraction, etc etc. for example if we have two large integers say
largeInt a("100000000000000000000000000000000000000000000000000000000000000000");
largeInt b("100000000000000000000000000000000000000000000000000000000000000000");
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 CMakeLists.txt
which takes care of building the project.
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 Created a PR https://github.com/ayaankhan98/bigINT/pull/17 Please review and merge.
I have previously written code for multiplying signed long numeric integer strings, would like to contribute to the multiply '*' operator? How to get started with this repo? Installation setup?
I have previously written code for multiplying signed long numeric integer strings, would like to contribute to the multiply '*' operator? How to get started with this repo? Installation setup?
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?
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. int a = 12; largeInt b = a;
Plus this will probably reduce the number of overloaded of other operators too.
Should implicit casting operators be also on this list. This will allow following use case. int a = 12; largeInt b = a;
Plus this will probably reduce the number of overloaded of other operators too.
yes, please create issue for this.
Should implicit casting operators be also on this list. This will allow following use case. int a = 12; largeInt b = a; 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
[x] * overload
[ ] / overload
[ ] += overload
[ ] -= overload
[ ] *= overload
[ ] /= overload
[ ] % overload
[ ] %= overload
[x] == overload
[x] = overload
[x] != overload
[x] < overload
[x] <= overload
[x] > overload
[x] >= overload
also include tests for corrosponding operators