Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid string access on modulo #75

Open
mristin opened this issue Mar 6, 2024 · 2 comments
Open

Invalid string access on modulo #75

mristin opened this issue Mar 6, 2024 · 2 comments

Comments

@mristin
Copy link

mristin commented Mar 6, 2024

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;
}
@formerlytomato
Copy link

formerlytomato commented Nov 15, 2024

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.

@faheel
Copy link
Owner

faheel commented Nov 19, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants