Overview of base/numerics library
masterThe base/numerics library is a dependency-free, header-only C++ template library designed for safe and performant numeric operations and conversions. It provides well-defined semantics for handling arithmetic errors, boundary conditions, and type conversions.
Key header files:
checked_math.h: ContainsCheckedNumericfor detecting errors like overflow or truncation.clamped_math.h: ContainsClampedNumericfor fast, non-sticky saturating arithmetic.safe_conversions.h: ContainsStrictNumericand custom casting templates for safe type conversion.safe_math.h: A convenience header that includes all the above.