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:
parent
8031f464fc
commit
8a7ffa9e8a
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue