}
std::string easyBItoString(const BigInteger &x) {
- return (x.getSign() == BigInteger::negative) ?
- (std::string("-") + easyBUtoString(x)) : (easyBUtoString(x));
+ return (x.getSign() == BigInteger::negative)
+ ? (std::string("-") + easyBUtoString(x.getMagnitude()))
+ : (easyBUtoString(x.getMagnitude()));
}
BigUnsigned easyStringToBU(const std::string &s) {
std::ostream &operator <<(std::ostream &os, const BigInteger &x) {
if (x.getSign() == BigInteger::negative)
os << '-';
- os << (const BigUnsigned &)(x);
+ os << x.getMagnitude();
return os;
}