BigInt
BigInt copied to clipboard
Invalid string access on modulo
The following modulo computation causes an invalid string access in the library:
#include "BigInt.hpp"
#include <iostream>
int main() {
BigInt number("12345678901234567890123456789012345678901234567889");
std::cout << number % 4 << std::endl;
return 0;
}
I attempted to run it myself with v0.5.0-dev and the code you provided, and it successfully compiled, ran, and returned 1 as an answer. It may be that the issue is fixed now.
It is also working in v0.4.0-dev: https://wandbox.org/permlink/a2dcxioVLxAxkS9f
@mristin Can you please share which OS, compiler, and CPU you were using?