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

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

Build:
Build:
LAST BUILD BRANCH: fix/fixpnt-quire-resolve-saturates
DEFAULT BRANCH: master
Ran 30 Oct 2026 12:14AM UTC
Jobs 1
Files 770
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

29 Oct 2026 11:54PM UTC coverage: 88.258% (+0.01%) from 88.244%
40976210318

push

github

web-flow
feat(posit): trunc, round, floor, ceil, fmod, remainder and frac without double, at any nbits (#1869)

These went through double, which is exact only while a posit's values
are doubles. posit<64,3> has 58 fraction bits near 1, so in posit<64,3>
floor(3 - 2^-56) was 3 and frac(7 + 2^-55) was 0; and posit<128,4> and
wider leave double's range, so fmod(2^1500, 3) was NaR.

trunc, round, floor and ceil are now computed on the encoding: clear the
fraction bits below the binary point, then step by one in magnitude for
floor, ceil and round, a sum that is exact (it stays in the binade or
carries to a power of two). isinteger() was `return true` for every
value; it now reads the fraction bits. No posit arithmetic is involved,
so they are 2.4-4x faster than through double (posit<32,2> floor 213 ->
96 ns, posit<128,4> 658 -> 172 ns).

fmod and remainder are correctly rounded rather than exact. A posit's
precision tapers away from 1, so x - n y can need more bits than the
posit has at its own scale. Both are computed exactly in efloat, whose
fmod and remainder are exact for any quotient (#1783), and rounded once
into the posit. frac(x) = x - trunc(x), which is exact. fmod is 1.5-3.2x
faster from 32 bits up and 1.4x slower at 16 (310 vs 222 ns).

The posit/efloat bridge (posit_limbs::to_efloat, exact, and from_efloat,
rounding once on the encoding) and the limb decode/encode that sqrt
used for wide posits now live in posit/math/posit_limbs.hpp and
efloat_bridge.hpp, for the rest of #1855.

Tests (static/tapered/posit/math): truncate.cpp is exhaustive to 24
bits and random to 32 against the double functions; past that it checks
the defining properties. fractional.cpp is exhaustive at 8 bits and
random to 32 against std::fmod and std::remainder in double, which are
exact and round once into the posit. Past that it uses exact references:
operands of a narrow posit, 58-bit integers near 1, which double cannot
hold, and 2^k mod m. efloat_bridge.cpp checks the round tr... (continued)

154 of 154 new or added lines in 6 files covered. (100.0%)

3 existing lines in 2 files now uncovered.

55659 of 63064 relevant lines covered (88.26%)

8834171.61 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
82.83
-0.3% include/sw/universal/number/qd/qd_impl.hpp
1
97.04
-0.06% include/sw/universal/number/cfloat/cfloat_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 40976210318.1 30 Oct 2026 12:14AM UTC 770
88.26
GitHub Action Run
Source Files on build 40976210318
  • Tree
  • List 770
  • Changed 6
  • Source Changed 4
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #40976210318
  • 0cb79608 on github
  • Prev Build on main (#40931355757)
  • Next Build on main (#40981456672)
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