faheel / BigInt

Arbitrary-sized integer class for C++
https://faheel.github.io/BigInt
MIT License
383 stars 131 forks source link

Invalid string access on modulo #75

Open mristin opened 6 months ago

mristin commented 6 months ago

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;
}