Massive cleanup of the entire codebase. Notable changes include:
[bigint/bigint.git] / BigIntegerUtils.cc
index c8f4df2..3ac75dc 100644 (file)
@@ -1,7 +1,3 @@
-/*
- * Matt McCutchen's Big Integer Library
- */
-
 #include "BigIntegerUtils.hh"
 #include "BigUnsignedInABase.hh"
 
@@ -16,8 +12,9 @@ std::string easyBUtoString(const BigUnsigned &x) {
 }
 
 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) {
@@ -55,6 +52,6 @@ std::ostream &operator <<(std::ostream &os, const BigUnsigned &x) {
 std::ostream &operator <<(std::ostream &os, const BigInteger &x) {
        if (x.getSign() == BigInteger::negative)
                os << '-';
-       os << (const BigUnsigned &)(x);
+       os << x.getMagnitude();
        return os;
 }