← All repos

tlfloat

C++ template library for floating point operations

arbitrary-precisionbfloat16constexprcpluspluscpp20cross-platformcudaelementary-functionsfloat128float256floating-pointhalf-precisionheaplessieee754librarymathoctuple-precisionquadruple-precisiontemplates
Browse cluster: RISC-V Toolchain & Math Libraries
222commits
4contributors
5languages

Tech stack & purpose

TLFloat is a C++ template library for floating-point arithmetic operations that implements classes for half, single, double, quadruple, and octuple precision IEEE 754 numbers. Built on arbitrary-precision integer templates, the library uses template expansion to enable operations across different precisions without reimplementing each operation separately. It supports truly constexpr functions compilable with C++20, works without dynamic memory allocation, and provides a wide range of mathematical functions including trigonometric, logarithmic, exponential, and hyperbolic operations with 1-ULP accuracy. The library is portable across Linux, Windows, microcontrollers, WebAssembly, and CUDA, and includes a libquadmath emulation layer for compatibility with clang and Visual Studio on x86_64 systems.

Community & reference links

Languages

C++
94.1%
CMake
2.2%
C
2.0%
Cuda
1.5%
Batchfile
0.2%

Contributors