fixed compile error due to explicit op and added some tests for bitwise xor which tests things well enough I think

This commit is contained in:
Pagwin 2024-12-11 20:35:36 -05:00
parent 8031f464fc
commit 8a7ffa9e8a
No known key found for this signature in database
GPG key ID: 81137023740CA260

View file

@ -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<unsigned long>(discard % Integer{10});
to_output << a;
discard /= 10;
}
@ -313,6 +313,10 @@ int main(void) {
assert(a / b == Integer{-2});
a = std::numeric_limits<long long>::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<long long>(i)} == a);