-1

I am currently trying to use this BitInt library for c++14 to perform larger calculations.

https://faheel.github.io/BigInt/

Every time two BitInts are multiplied an error appears. I reinstalled Visual Studio and the underlying compiler and I am running the latest version.

Error message

The thread 0x2918 has exited with code 0 (0x0).
Exception thrown at 0x00007FFDA337F530 (ucrtbased.dll) in MyProg.exe: 0xC0000005: Access violation reading location 0x00007FF8A3E3A84F.

Here is my code

#include <iostream>
#include "../BigInt/BigInt.hpp"


int main()
{
    BigInt big1, big2;
    big1 = "2";
    big2 = "9876543210123456789098765432101234567890";

    std::cout << (big1 * big2).to_string();
    // std::cout << big1 * big2 * 123456 << "\n";

    return 0;
}

A Screenshot

This is a screenshot of the file the error is in

  • the 0.5.0 release works for me – Alan Birtles Mar 13 '21 at 09:00
  • I'll suggest using either [GMP's mpz](https://gmplib.org) or [boost's cpp_int](https://github.com/boostorg/multiprecision) these are the best that you can get, I would also suggest [bint](https://github.com/mrdcvlsc/APA) and [InfInt](https://github.com/sercantutar/infint) these two might not be as fast as GMP and Boost but they are faster than the one you are currently using, plus the implementation is much simpler so you can learn it. – 0xdeadbeef Sep 13 '22 at 17:15

1 Answers1

0

Not all open-source software is meant to work good. Unfortunately. This looks like a bug in the library that you use. I'd recommend to post an issue on the library's GitHub repository. After that, if you are willing to, you also can try to debug library internals, make a fix and post a PR with fix back to the library. Otherwise, I'd recommend to use more time-proven libraries, for example Crypto++.

ivan.ukr
  • 2,853
  • 1
  • 23
  • 41
  • Thanks. I've tried rewriting the library, but I have far too little experience with C ++ right now. I am going to take a look into Crypto++. – Lukas Weber Mar 13 '21 at 15:33