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

stillwater-sc / universal / 24922868498
84%
master: 84%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 25 Apr 2026 05:12AM UTC
Jobs 1
Files 633
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

25 Apr 2026 04:45AM UTC coverage: 84.378% (+0.03%) from 84.346%
24922868498

push

github

web-flow
feat(posit): full constexpr arithmetic, comparison, and conversion-out (#755)

* feat(posit): full constexpr arithmetic, comparison, and conversion-out

Resolves #718. Builds on #714, #716, #717, #725, #752 and completes the
posit constexpr surface. After this PR:

  constexpr posit<32,2> a(2.0), b(3.0);
  constexpr auto sum  = a + b;     // works
  constexpr auto prod = a * b;     // works
  constexpr auto neg  = -a;        // works
  static_assert(a < b);            // works

The chain promoted to constexpr (in dependency order):

  blockbinary::operator+, operator-, to_ull (free + member)
  decode_regime, extract_fields, decode (free posit helpers)
  positRegime: ctors, reset, scale, set, setzero, setinf, regime_size,
               assign, assign_regime_pattern, iszero, bits, nrBits,
               positRegime_k, positRegime_run
               (value() left non-constexpr -- uses std::ldexp)
               (increment() left non-constexpr -- uses std::cout)
  positExponent: ctors, reset, setzero, nrBits, scale, value, bits,
                 set, setNrBits, extract_exponent_bits
  positFraction: ctors, none, bits, nrBits, value, reset, setzero, set
  convert(blocktriple, posit) free function
  posit::operator-(), operator++, operator--, operator+=, -=, *=, /=
  posit free binary operator+, -, *, /
  posit free comparison operator==, !=, <, >, <=, >= (and matching
    friend declarations)

Also converted four `if (_trace_X) std::cout` runtime branches in posit
compound operators to `if constexpr`, since the trace constants are
already `constexpr false` and the runtime form blocked constant
evaluation.

Tests: static/tapered/posit/api/api.cpp gets a third constexpr block
(after the integer and IEEE-754 ones from prior PRs) covering:
  constexpr a + b, a - b, a * b, b / a, -a
  constexpr lambda += and *=
  static_assert on comparison results (==, <, >=)
  bit-equivalent cross-check vs runtime construction
  exact arithmetic on representable values (2+3 ... (continued)

54 of 55 new or added lines in 5 files covered. (98.18%)

3 existing lines in 1 file now uncovered.

44954 of 53277 relevant lines covered (84.38%)

6445788.52 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
94.25
0.0% include/sw/universal/number/posit/posit_impl.hpp

Coverage Regressions

Lines Coverage ∆ File
3
80.58
-0.67% include/sw/universal/number/posit1/specialized/posit_16_1.hpp
Jobs
ID Job ID Ran Files Coverage
1 24922868498.1 25 Apr 2026 05:12AM UTC 633
84.38
GitHub Action Run
Source Files on build 24922868498
  • Tree
  • List 633
  • Changed 9
  • Source Changed 5
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24922868498
  • 1544a0a5 on github
  • Prev Build on main (#24916020162)
  • Next Build on main (#24931269268)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc