Description
SLIMCPP is C++ headeronly library that implements long integers that exceed maximum size of native type supported by a specific compiler.
SLIMCPP alternatives and similar libraries
Based on the "Math" category.
Alternatively, view slimcpplib alternatives based on common mentions on social networks and blogs.

OpenBLAS
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. 
Eigen
A highlevel C++ library of template headers for linear algebra, matrix and vector operations, numerical solvers and related algorithms. [MPL2] 
TinyExpr
tiny recursive descent expression parser, compiler, and evaluation engine for math expressions 
MIRACL
MIRACL Cryptographic SDK: Multiprecision Integer and Rational Arithmetic Cryptographic Library is a C software library that is widely regarded by developers as the gold standard open source SDK for elliptic curve cryptography (ECC). 
NT2
A SIMDoptimized numerical template library that provides an interface with MATLABlike syntax. [Boost] 
linmath.h
a lean linear math library, aimed at graphics programming. Supports vec3, vec4, mat4x4 and quaternions 
ExprTK
C++ Mathematical Expression Parsing And Evaluation Library https://www.partow.net/programming/exprtk/index.html 
LibTomMath
LibTomMath is a free open source portable number theoretic multipleprecision integer library written entirely in C. 
muparser
official repository of the muparser fast math parser library 
GMTL
Generic Math Template Library (forked from http://ggt.sourceforge.net/) 
safe_numerics
Replacements to standard numeric types which throw exceptions on errors 
blaze
highperformance C++ math library for dense and sparse arithmetic. [BSD] 
Versor
[older version] Versor 1.0 C++ library for conformal geometric algebra draw routines 
Xerus
A general purpose library for numerical calculations with higher order tensors, TensorTrain Decompositions / Matrix Product States and other Tensor Networks 
Mission : Impossible (AutoDiff)
A concise C++17 implementation of automatic differentiation (operator overloading) 
ceval
A C/C++ library for parsing and evaluation of arithmetic expressions. 
macadam
Typegeneric math and numerical library supporting c99 and cpp98 (header only). 
Armadillo
A high quality C++ linear algebra library, aiming towards a good balance between speed and ease of use. The syntax (API) is deliberately similar to Matlab. [MPL2] 
GMP
A C/C++ library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floatingpoint numbers. [LGPL3 & GPL2]
Build timeseriesbased applications quickly and at scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of SLIMCPP or a related project?
README
SLIMCPP
Simple long integer math library for C++
SLIMCPP is a C++ headeronly library that implements long integers that exceed maximum size of native type supported by a specific compiler by 24 times. All classes, methods and functions were not created or designed to work with huge numbers, for which there are specialized big integer mathematical libraries. In some cases, it is necessary to temporarily perform calculations with precision exceeding the maximum supported size of integers, and then return the result to its native size again. The conditions are ideal for SLIMCPP. The main features:
 easy to use: the library is headeronly
 small: consists of few header files, there is no dependencies
 speed: use intrinsics if supported
 crossplatform: supports MSVC, GCC and CLANG C++17 compilers
 exception neutral: doesn't use exceptions, all methods are noexсept
The library implements two main classes:
namespace slim
{
template<typename native_t = uintmax_t, uint_t size = 2>
class long_uint_t; // unsigned integer
template<typename native_t = uintmax_t, uint_t size = 2>
class long_int_t; // signed integer
} // namespace slim
where native_t may be one of base unsigned type and size must by power of two.
Implementation
 [long_int.h](include/slimcpplib/long_int.h)  signed long integer class (Can be completely removed if not used)
 [long_uint.h](include/slimcpplib/long_uint.h)  unsigned long integer class
 [long_math.h](include/slimcpplib/long_math.h)  crossplatform helper classes and functions
 [long_math_long.h](include/slimcpplib/long_math_long.h)  crossplatform helper classes and functions (long_uint_t/long_int_t specializations)
 [long_math_gcc.h](include/slimcpplib/long_math_gcc.h)  GCC, CLANG helper classes and functions (Can be completely removed if irrelevant)
 [long_math_msvc.h](include/slimcpplib/long_math_msvc.h)  MSVC helper classes and functions (Can be completely removed if irrelevant)
 [long_io.h](include/slimcpplib/long_io.h)  standard stream input/output (Can be completely removed if not used) ## Integration The library implements four predefined types: uint128_t, uint256_t, int128_t, int256_t. You can use them in your project by include code below: ```c++ #include // Include all integers support // or #include // Include only unsigned integers support
namespace your_namespace { using uint128_t = slim::uint128_t; using uint256_t = slim::uint256_t; using int128_t = slim::int128_t; using int256_t = slim::int256_t; using namespace slim::literals;
} // namespace your_namespace
## Constant declaration:
```c++
constexpr auto uo = 03766713523035452062041773345651416625031020_ui128; // octal unsigned integer
constexpr auto ud = 338770000845734292534325025077361652240_ui128; // decimal unsigned integer
constexpr auto uh = 0xfedcba9876543210fedcba9876543210_ui128; // hexadecimal unsigned integer
constexpr auto io = 03766713523035452062041773345651416625031020_si128; // octal signed integer
constexpr auto id = 338770000845734292534325025077361652240_si128; // decimal signed integer
constexpr auto ih = 0xfedcba9876543210fedcba9876543210_si128; // hexadecimal signed integer
also supported (') separator for integer literals:
constexpr auto u = 0xfedcba98'76543210'fedcba98'76543210_ui128; // hexadecimal unsigned integer
Construction:
const uint128_t u; // construct uninitialized unsigned integer
const uint128_t u = 1U; // construction from unsigned integer
const int128_t s = 1; // construction from signed integer
const uint128_t u = 10000_ui128; // construction from long unsigned integer
const int128_t u = 10000_si128; // construction from long signed integer
const uint128_t u = true; // construction from boolean value
Operators
long_uint_t type supports following operators:
==, !=, <, <=, >, >=, <<=, <<, >>=, >>, +=, +, ++, =, , , *=, *, /=, /, %=, %, ~, &=, &, =, , ^=, ^
long_int_t type supports following operators:
==, !=, <, <=, >, >=, +=, +, ++, =, , , *=, *, /=, /, %=, %
MulDiv
The library implements the muldiv method for faster calculation of the following expressions: (a * b / c). It can be used with signed and unsigned integers.
template<typename type_t> constexpr type_t muldiv(const type_t& value, const type_t& multiplier, const type_t& divider) noexcept;
Standard stream input/output
std::cout << std::oct << 338770000845734292534325025077361652240_ui128 << "\n"; // octal std::cout << std::dec << 03766713523035452062041773345651416625031020_ui128 << " \n"; // decimal std::cout << std::hex << 0xfedcba9876543210fedcba9876543210_ui128 << "\n"; // hexadecimal
Limitations
Although all methods and functions are defined using the constexpr qualifier, due to the limitations of C++ 17, working completely at compile time is only possible for code without instrinsics, since there is no implementation of std::is_constant_evaluated() in the standard before C++ 20.
The design of long integers tries to completely repeat the behavior of native integers, but still differs. For example, the propagation of integer types always occurs from a signed integer to an unsigned integer, and an implicit conversion from a larger integer to a smaller integer does not cause a warning, but a compilation error.
Location of digits always corresponds to littleendian, regardless of the platform, which should be taken into account when serialization/deserialization. The digits themselves are always in platform natural order.
Examples
[main.cpp](examples/main.cpp)  examples of using the main interface of the library with comments.
Performance
All measurements are not intended to be a strong performance tests and are provided simply for relative comparison of the operation costs. All measurements were taken on Intel (R) Core (TM) i59400F CPU @ 2.90GHz in a 64bit configuration with 128bit integers.  Operation  Average time (in ns.)  :  Unsigned addition  0.25   Signed addition  0.25   Unsigned subtraction  0.25   Signed subtraction  0.25   Unsigned multiplication  7.00   Signed multiplication  7.00   Unsigned division  15.00   Signed division  20.00   Unsigned muldiv()  20.00   Signed muldiv()  25.00 