https://github.com/cppalliance/int128
Portable implementations of signed and unsigned 128-bit integers
https://github.com/cppalliance/int128
128-bit cpp14 cpp14-library
Last synced: 19 days ago
JSON representation
Portable implementations of signed and unsigned 128-bit integers
- Host: GitHub
- URL: https://github.com/cppalliance/int128
- Owner: cppalliance
- License: bsl-1.0
- Created: 2025-03-17T15:31:18.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-05-23T20:29:12.000Z (8 months ago)
- Last Synced: 2025-05-27T08:41:44.221Z (8 months ago)
- Topics: 128-bit, cpp14, cpp14-library
- Language: C++
- Homepage: https://master.int128.cpp.al
- Size: 558 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Boost.int128 (candidate library)
Portable implementations of signed and unsigned 128-bit integers
| | Master | Develop |
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|
| Drone | [](https://drone.cpp.al/cppalliance/int128) | [](https://drone.cpp.al/cppalliance/int128) |
| Github Actions | [](https://github.com/cppalliance/int128/actions/workflows/ci.yml) | [](https://github.com/cppalliance/int128/actions/workflows/ci.yml)
| Codecov | [](https://codecov.io/gh/cppalliance/int128) | [](https://codecov.io/gh/cppalliance/int128) |
---
# 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.
## CMake
```sh
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
```sh
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:
```cpp
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 ``, ``, `` etc.).
The entire library can be conveniently included with `#include `
# Full Documentation
The complete documentation can be found at: https://master.int128.cpp.al
## References
[1] Donald E. Knuth, _The_ _Art_ _of_ _Computer_ _Programming_ _Volume_ _2_ _Seminumerical_ _Algorithms_, 3rd edition, 1998