SkillAgentSearch skills...

Int128

Portable implementations of signed and unsigned 128-bit integers

Install / Use

/learn @cppalliance/Int128
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Boost.int128 (candidate library)

Portable implementations of signed and unsigned 128-bit integers

| | Master | Develop | |------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------| | Drone | Build Status | Build Status | | Github Actions | CI | CI | Codecov | codecov | codecov |

Notice

int128 is under active development and is not an official boost library.

How To Use The Library

This library is header only. It contains no other dependencies. Simply #include it and use it. With C++20 and greater you can instead import boost.int128.

CMake

git clone https://github.com/cppalliance/int128
cd int128
mkdir build && cd build
cmake .. OR cmake .. -DCMAKE_INSTALL_PREFIX=/your/custom/path
cmake --build . --target install

then you can use find_package(boost_int128 REQUIRED)

vcpkg

git clone https://github.com/cppalliance/int128
cd int128
vcpkg install int128 --overlay-ports=ports/int128 

Supported Platforms

Boost.Int128 is tested natively on Ubuntu (x86_64, x86_32, s390x, aarch64, ARM32v7), macOS (x86_64, and Apple Silicon), and Windows (x86_64, x86_32, and ARM64); as well as emulated PPC64LE using QEMU with the following compilers:

  • GCC 5 and later
  • Clang 5 and later
  • Visual Studio 2017 (14.1) and later
  • Intel OneAPI DPC++

Synopsis

Int128 provides 2 types:

namespace boost {
namespace int128 {

struct uint128_t;
struct int128_t;

} //namespace int128
} //namespace boost

These types operate like built-in integer types. They have their own implementations of the Standard-Library functions (e.g., like those found in <limits>, <iostream>, <bit> etc.).

The entire library can be conveniently included with #include <boost/int128.hpp>

Full Documentation

The complete documentation can be found at: https://develop.int128.cpp.al

References

[1] Donald E. Knuth, The Art of Computer Programming Volume 2 Seminumerical Algorithms, 3rd edition, 1998

View on GitHub
GitHub Stars9
CategoryDevelopment
Updated10h ago
Forks3

Languages

C++

Security Score

90/100

Audited on Apr 2, 2026

No findings