Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C/C++
  3. CNL

CNL

BSL-1.0C++v1.1.2

A C++ library providing fixed-precision numeric types for safer, simpler, and more efficient arithmetic in constrained environments.

GitHubGitHub
693 stars69 forks0 contributors

What is CNL?

CNL (Compositional Numeric Library) is a C++ library that provides fixed-precision numeric classes to enhance integers for safer, simpler, and more efficient arithmetic. It solves problems in environments where floating-point units are absent or costly, or where precision is critical, such as in finance, simulations, and DSP applications.

Target Audience

C++ developers working in compute-constrained or energy-intensive environments, such as embedded systems, simulations, machine learning, DSP, and financial applications where precise and efficient arithmetic is essential.

Value Proposition

Developers choose CNL for its compositional design that minimizes performance and precision loss, its header-only ease of integration, and its focus on safety and efficiency in arithmetic operations without relying on floating-point hardware.

Overview

A Compositional Numeric Library for C++

Use Cases

Best For

  • Embedded systems without FPUs where fixed-point arithmetic is required
  • Financial applications demanding precise decimal arithmetic
  • Digital signal processing (DSP) needing efficient real-number approximations
  • Simulations and machine learning where arithmetic is a performance bottleneck
  • Energy-constrained environments optimizing compute efficiency
  • Projects requiring safe and simple integer-backed numeric types

Not Ideal For

  • Projects that rely heavily on standard floating-point types with available FPUs and no precision concerns
  • Teams needing extensive mathematical functions beyond core arithmetic, as CNL focuses on types rather than a comprehensive math library
  • Applications with strict compilation time constraints where header-only libraries could cause significant build overhead
  • Developers unfamiliar with fixed-point arithmetic concepts who prefer more abstracted numeric solutions

Pros & Cons

Pros

Fixed-Precision Efficiency

Provides integer-backed real number approximations that minimize performance loss, ideal for environments without floating-point units, as emphasized in its target applications like embedded systems.

Header-Only Integration

Easy to integrate without complex build dependencies; you can simply include headers, as shown in the instructions with examples like adding the include directory directly.

Modern C++ Compatibility

Built for C++20 with a version 1.x supporting C++11, ensuring forward compatibility and use across various codebases, as detailed in the requirements section.

Cross-Platform Reliability

Continuously tested on GCC, Clang, Visual Studio, and multiple standard libraries, providing robust support across different toolchains, as listed in the tested systems.

Cons

Limited Mathematical Functions

Compared to alternatives like fpm, CNL lacks a high quantity of mathematical functions, focusing more on arithmetic types, as acknowledged in the alternatives section.

Complex Test Setup

Running the test suite requires Conan and specific CMake configurations, which can be cumbersome for quick validation, as seen in the multi-step build instructions.

Conceptual Overhead

Requires familiarity with fixed-point arithmetic concepts, which may pose a learning curve for developers new to this domain, despite the compositional design.

Frequently Asked Questions

Quick Stats

Stars693
Forks69
Contributors0
Open Issues64
Last commit2 years ago
CreatedSince 2017

Tags

#embedded-systems#simulation#fixed-point#financial-computing#precision#performance-optimization#embedded#dsp#c-plus-plus-20#cmake#c-plus-plus#safe#fixed-point-arithmetic#deterministic#cpp#header-only#arithmetic

Built With

c
c++20
C
CMake
G
Google Test
G
Google Benchmark

Included in

C/C++70.6k
Auto-fetched 23 hours ago

Related Projects

DLIBDLIB

A toolkit for making real world machine learning and data analysis applications in C++

Stars14,455
Forks3,438
Last commit2 days ago
OpenGL MathematicsOpenGL Mathematics

OpenGL Mathematics (GLM)

Stars11,255
Forks2,409
Last commit6 months ago
QuantLibQuantLib

The QuantLib C++ library

Stars7,652
Forks2,337
Last commit3 days ago
OpenBLASOpenBLAS

OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.

Stars7,608
Forks1,734
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub