simple fixes

This commit is contained in:
Andrei Yankovich 2019-07-09 22:15:32 +03:00
parent e55e6a2d2c
commit ffa3abead3
2 changed files with 5 additions and 6 deletions

View File

@ -147,7 +147,7 @@ BigInt& operator -=(BigInt &left, int right) {
}
BigInt& operator -=(int left, BigInt & right) {
if (left > 0) {
if (left >= 0) {
return static_cast<unsigned int>(left) -= right;
}
@ -511,8 +511,8 @@ bool operator >= ( const BigInt &left, int right) {
return mpz_cmp_si(left.data, right) >= 0;
}
// cast operations
//// cast operations
BigInt::operator bool() const {
return *this != 0;
}
//BigInt::operator bool() const {
// return *this != 0;
//}

View File

@ -151,7 +151,6 @@ public:
friend BigInt& operator^= (BigInt &left, int right);
friend BigInt& operator^= (BigInt &left, unsigned int right);
operator bool() const;
};
#endif // BIGINT_H