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

stillwater-sc / universal / 43915301650
89%
master: 84%

Build:
Build:
LAST BUILD BRANCH: fix/fixpnt-quire-resolve-saturates
DEFAULT BRANCH: master
Ran 16 Nov 2026 05:40PM UTC
Jobs 1
Files 898
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

16 Nov 2026 05:09PM UTC coverage: 89.224% (+0.01%) from 89.214%
43915301650

push

github

web-flow
fix(numeric): integer casts reserve the integer NaR for NaN, saturate to +/-max; microfloat casts follow the rule (#2108)

The integer-cast rule of #2073 mapped NaR to min(), and a large negative value
saturated to min() too, so the two could not be told apart; an unsigned cast
mapped NaR to 0, the value zero gives. The amended rule, in the new
number/shared/integer_cast.hpp, is shared by posit, bposit, takum, takum_log,
cfloat and microfloat:
- a finite value truncates toward zero, exactly;
- a value past the range, inf included, saturates to [-max, max], or to
  [0, max - 1] for an unsigned type (a negative value gives 0);
- NaN / NaR gives the integer NaR: min() (the 100...0 pattern of a posit NaR),
  or max() for an unsigned type.

microfloat's casts were static_casts of its float: undefined behaviour for NaN,
inf and every value outside the target, which in the 8-bit formats are ordinary
values (short(e5m2(57344)), (signed char)e4m3(448), unsigned(e4m3(-1))), and
platform dependent in practice (x86 INT_MIN, ARM saturating with NaN -> 0).
They now follow the rule and stay constexpr noexcept.

Docs: the rule is stated once in docs/number-systems/posit.md (Integer casts)
and linked from cfloat, takum, bposit, microfloat and takum-design. microfloat.md
and nvblock.md gain a Design decisions section: the cast rule, and nvblock's NaN
input making the whole block NaN (#2102), with its trade-offs.
docs-site/sync-content.mjs keeps a #anchor when it rewrites a .md link.

Tests: new static/block/microfloat/conversion/integer_casts.cpp (every encoding
of seven formats, ten integer types; does not compile on main, the constexpr
casts being UB there). The cast tests of posit (integer_edges), takum (integer),
takum_log (ieee754), bposit (conversion) and cfloat (integer_casts) check the
amended rule, unsigned targets included; each fails on main.

posit gains unsigned integer casts (operator unsigned int / long / long long,
to_integer<> for unsigned targets) so ... (continued)

51 of 51 new or added lines in 7 files covered. (100.0%)

2 existing lines in 1 file now uncovered.

64070 of 71808 relevant lines covered (89.22%)

12413746.88 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
98.12
-0.13% include/sw/universal/number/cfloat/cfloat_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 43915301650.1 16 Nov 2026 05:40PM UTC 898
89.22
GitHub Action Run
Source Files on build 43915301650
  • Tree
  • List 898
  • Changed 7
  • Source Changed 6
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #43915301650
  • dff560f8 on github
  • Prev Build on main (#43841038115)
  • Next Build on main (#43944148836)
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