Skip to content
CAI
Software that uses CAICheck a score

ericmj/decimal

68.8

Adequate · 15 November 2026

3.8k

lines of production code

Elixir

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Security

Mitigation of decimal exponent amplification vulnerability ([CVE redacted])

The library now applies default limits to \parse/1\, \cast/1\, and string conversion functions to reject pathological inputs with extremely large exponents (e.g., \1e1000000\) that could cause excessive memory or CPU usage. By default, these functions enforce a maximum digit count of 34 and a maximum exponent of 6,144, aligning with IEEE 754 decimal128 standards, to prevent denial-of-service scenarios without requiring explicit configuration.

lib · high confidence

Behavioural changes

Decimal library performance optimizations and bug fixes

This release significantly improves the performance of core Decimal operations, including division, addition, subtraction, multiplication, rounding, normalization, comparison, and parsing, with reported speedups ranging from 1.2x to 1.9x and reduced memory allocation. It also optimizes \Decimal.to\_float/1\ for faster conversion, especially for values with extreme exponents. Several bugs are fixed: \Decimal.div/2\ now correctly carries the division remainder into rounding as a sticky bit to prevent incorrect rounding on inexact results; \Decimal.round/3\ now applies only the caller's rounding mode instead of the context's first; and \Decimal.to\_integer/1\ no longer enters an infinite loop for zero coefficients with negative exponents. Additionally, \Decimal.round/3\ no longer signals \:inexact\ or \:rounded\ for digits it discards itself, aligning with expected behavior for explicit rounding calls.

(repo-wide) · high confidence

Introduction of IEEE 754 compliant decimal context and simplified error handling

The library now supports configurable arithmetic contexts (precision, rounding, exponents, traps) stored in the process dictionary, defaulting to IEEE 754 decimal128 settings. This allows users to control how decimal operations behave, such as rounding strategies and overflow/underflow handling. Additionally, the \Decimal.Error\ exception structure has been simplified to only include \:signal\ and \:reason\ fields, removing previous \:message\ and \:result\ fields, which changes how errors are constructed and inspected.

lib/decimal · high confidence

Test coverage

Added comprehensive test coverage for Decimal context and property-based validation; Expanded test suite with property-based testing and performance bounds.

Dependencies

Update to Elixir 1.12+ and modernize project metadata

The project now requires Elixir 1.12 or higher, dropping support for older versions. The \mix.exs\ has been updated to include standard Hex package metadata (name, description, licenses, and source URL) and configures documentation generation via \ex\_doc\. Dependencies have been refreshed, with \ex\_doc\ pinned to the latest version for development and \stream\_data\ added for testing.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 68 → 69 (+1.2)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 98 → 97 (-0.9)
  • Architecture 100 → 100 (+0.0)
  • Maturity 50 → 53 (+2.7)
  • Readiness 69 → 69 (+0.0)
  • Security 100 → 100 (+0.0)
  • Performance 90 → 90 (+0.0)

Resolved (2)

  • Further sole-owners (lower concentration)
  • Off-boarding risk: anonymized user #1

New (3)

  • Edited copies of one member (3 members, 15+ corresponding lines) (lib/decimal.ex)
  • Edited copy of a member (20 corresponding lines) (lib/decimal.ex)
  • Off-boarding risk: anonymized user #1

Changes since last survey

  • 3 commits — 3 feature/other, 0 fixes

By area

  • lib/decimal.ex — 3 commits

Notable commits

  • change: Reuse strip_trailing_zeros without intermediate Decimal structs (#257)
  • change: Simplify and inline bit_length calculation (#256)
  • change: Use fused quotient/remainder operations in arithmetic (#255)

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

ericmj/decimal was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 15 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 5ff7eb4c0c4c7e4d698d0ea386d65a22a81edba4 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-3c33c1882dc1.