Open MahmoudRizk opened 7 years ago
Can you give an example of when it produces an incorrect result?
#include <iostream>
#include"bigint.h"
using namespace std;
using namespace Dodecahedron;
int main(int argc, char* argv[]){
Bigint a("-5");
Bigint b("-10");
Bigint c;
c = a * b;
cout << c<< endl;
return 0;
}
output : - 50 correct : 50
#include <iostream>
#include"bigint.h"
using namespace std;
using namespace Dodecahedron;
int main(int argc, char* argv[]){
Bigint a("5");
Bigint b("-10");
Bigint c;
c = a*b;
cout << c<< endl;
return 0;
}
output : 50 correct : -50
#include <iostream>
#include"bigint.h"
using namespace std;
using namespace Dodecahedron;
int main(int argc, char* argv[]){
Bigint a("-5");
Bigint c;
c = a * -5;
cout << c<< endl;
return 0;
}
output: - - 25 correct: 25
#include <iostream>
#include"bigint.h"
using namespace std;
using namespace Dodecahedron;
int main(int argc, char* argv[]){
Bigint a("234523452356235423452345");
Bigint c;
c = a * -2;
cout << c<< endl;
return 0;
}
output : -469046-904712470-846904690 correct : -469046904712470846904690
Okay, thanks for the pull request.
I'll go over it this weekend.
I recommend to check the Subtraction pull request https://github.com/kasparsklavins/bigint/pull/19 too, because i want to make sure that the division is working correctly since it depends on it. @kasparsklavins
Sure. Been busy lately but I'll get to it.
There were a bug when multiplying signed numbers, so i fixed it. #26