infinite integers in one C++ header with zero dependencies.
A high-efficiency, high-precision infinite-integer arithmetic library. Drop inf.hpp into any C++17 project.
#include "inf.hpp"
int main() {
inf::integer a = "12345678901234567890";
inf::integer b = 42;
std::cout << a * b << "\n";
}Schoolbook → Karatsuba → NTT → Schönhage–Strassen, Knuth Algorithm D, Lehmer GCD, Montgomery modexp, Baillie–PSW. Details: docs/algorithms.md. API: docs/api.md.
| Path | Role |
|---|---|
inf.hpp |
The library |
docs/ |
Algorithms and API |
tests/ |
./tests/build (Alpine image) or make -C tests unit / make -C tests rsa (RSA-OAEP Alice/Bob) |
MIT — see LICENSE.
inf.cpp is neither affiliated nor does it fork the below-mentioned projects, but I acknowledge their precedence and influence: