diff --git a/integer.cpp b/integer.cpp index 7a22541..99002fa 100644 --- a/integer.cpp +++ b/integer.cpp @@ -272,7 +272,7 @@ public: Integer discard = rhs; std::stringstream to_output{}; while (discard != Integer{0}) { - int a = discard % Integer{10}; + int a = static_cast(discard % Integer{10}); to_output << a; discard /= 10; } @@ -313,6 +313,10 @@ int main(void) { assert(a / b == Integer{-2}); a = std::numeric_limits::max(); b = a; + for (unsigned long i = 0; i < 20; i++) { + Integer n = i; + assert(((unsigned long)n ^ i) == 0); + } for (std::size_t i = 2; i < 20; i++) { a += b; assert(b * Integer{static_cast(i)} == a);