Bigint (bigbit) library

前端 未结 3 1483
盖世英雄少女心
盖世英雄少女心 2020-11-27 07:37

I\'m looking for a c++ class/library that provides 1024 bit and bigger integers and bit operations like: - bit shifting, - bitwise OR/AND, - position first zero bit

相关标签:
3条回答
  • 2020-11-27 08:18

    There are several, including GMP, but for speed, the best is likely TTmath. TTmath's design decision to use templated fixed lengths at compiletime lets it be quite fast.

    0 讨论(0)
  • 2020-11-27 08:22

    try gmp library. It is a C library. Beginning with GMP 4.0 a C++ wrapper is bundled with the release.

    0 讨论(0)
  • 2020-11-27 08:23

    Just consider the big integer multiplication, the TTmath Library use Karatsuba algorithm, which has time complexity $O(n^{1.585})$. The fastest algorithm is $O(n log n log log n)$, using FFT.

    0 讨论(0)
提交回复
热议问题