• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kaidokert / fixed-bigint-rs / 29693523494
97%

Build:
DEFAULT BRANCH: main
Ran 19 Jul 2026 03:47PM UTC
Jobs 1
Files 44
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Jul 2026 03:46PM UTC coverage: 97.833% (+0.04%) from 97.79%
29693523494

push

github

web-flow
CheckedDiv/CheckedRem + saturating family for HeaplessBigInt (#152)

* Add CheckedDiv/CheckedRem and the saturating family to HeaplessBigInt

Two of the three remaining num_traits::PrimInt blockers (the third is Num /
from_str_radix).

CheckedDiv/CheckedRem (div_rem.rs, Nct — division is Nct-only): return None
on divide-by-zero instead of the div_rem_impl assert, so div-by-zero is
reachable without the panicking operator. Inherent + const_num_traits +
num_traits trait forms.

Saturating (arith.rs): inherent saturating_add/sub (P-generic) and
saturating_mul, const_num_traits Saturating{Add,Sub,Mul} (Nct, matching the
Checked* gating), and num_traits::Saturating (Nct). Correctness point: the
saturation target is the all-ones value at the OPERAND width max(a.len,b.len)
via max_at_len, NOT Bounded::max_value() — on this carrier that's the CAP-wide
max, which would over-saturate a sub-capacity value. FixedUInt can use
Bounded::max_value() because its width IS N; heapless can't.

Tests: generic bodies for both carriers in carrier_generic.rs (const traits)
and carrier_num_traits.rs (num_traits bridges), plus heapless-internal tests
that the fixed-width harness can't reach — saturation clamps to the operand
width (len 1 in a CAP-8 carrier), not CAP, and checked div/rem by zero is None.

* Gate HeaplessBigInt saturating_* to Nct (Ct branch leaks saturation)

The inherent saturating_add/sub/mul were on the P-generic impl block, so the
Ct personality got them too — and they branch on the (secret-derived) overflow
flag, leaking whether saturation happened. FixedUInt keeps its Ct saturating
branchless via const_ct_select; heapless does not, so move the inherent methods
to Nct-only impl blocks, matching the already-Nct-gated Saturating* trait
forms. A branchless Ct saturating is left as future work, consistent with
heapless keeping its Ct trait surface minimal.

91 of 91 new or added lines in 2 files covered. (100.0%)

4560 of 4661 relevant lines covered (97.83%)

6106.25 hits per line

Jobs
ID Job ID Ran Files Coverage
1 29693523494.1 19 Jul 2026 03:47PM UTC 44
97.83
GitHub Action Run
Source Files on build 29693523494
  • Tree
  • List 44
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #29693523494
  • 9a973922 on github
  • Prev Build on main (#29680648590)
  • Next Build on main (#29695007441)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc