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

stillwater-sc / universal / 28328952317
85%
master: 84%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 28 Jun 2026 05:21PM UTC
Jobs 1
Files 689
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

28 Jun 2026 04:40PM UTC coverage: 84.642% (+0.03%) from 84.614%
28328952317

push

github

web-flow
feat(efloat): implement mathematical truncation and rounding library (#1125)

* feat(efloat): implement mathematical truncation and rounding library (#1112)

Implement trunc(), floor(), ceil(), round(), rint(), nearbyint(), lrint(), and llrint()
inside math/truncate.hpp, performing standard mathematical rounding completely at the
exact bit-level of efloat's own normalized representation.

Declare these mathematical functions as friend functions inside efloat_impl.hpp,
granting them direct, high-performance permission to clear fractional bits of the
protected _limb vector.

Register math/truncate.hpp inside our master efloat mathlib.hpp header.

Create truncate.cpp inside elastic/efloat/math/ to verify all truncation and rounding
functions across all positive, negative, and exact halfway-tie boundary states.

Resolves #1112
Relates to parent Issue #1092, Epic #1101

* fix(efloat): resolve CodeRabbit review comments on truncation library

1. Implement high-precision, lossless lrint() and llrint() inside math/truncate.hpp:
   convert the rounded efloat directly at the bit-level without double-cast, preventing
   precision truncation for values above 2^53.

2. Preserve negative zero: save the original sign before clear_fractional_limbs() and restore
   it on res.iszero() under trunc, floor, ceil, round, and rint, matching standard IEEE-754
   and cmath sign preservation.

3. Implement rounding-mode rint(): update rint() to branch on the active efloat_rounding_mode
   under RoundToNearest (ties-to-even), RoundToZero (truncation), RoundTowardPositive,
   and RoundTowardNegative, matching std::rint behavior.

4. Fix sticky-bit boundary check: correct the first_extra_limb starting index inside round()
   and rint() to prevent skipping full_limbs + 1 when bit_idx < 31, successfully
   matching all sticky bit transitions.

5. Update regressions: expand truncate.cpp to cover rint() dynamic rounding mode selections,
   lossless llrint() above 2^53, nearbyint() re... (continued)

190 of 230 new or added lines in 1 file covered. (82.61%)

49005 of 57897 relevant lines covered (84.64%)

6713186.71 hits per line

Uncovered Changes

Lines Coverage ∆ File
40
82.61
include/sw/universal/number/efloat/math/truncate.hpp
Jobs
ID Job ID Ran Files Coverage
1 28328952317.1 28 Jun 2026 05:21PM UTC 689
84.64
GitHub Action Run
Source Files on build 28328952317
  • Tree
  • List 689
  • Changed 4
  • Source Changed 1
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28328952317
  • 97f8a5ba on github
  • Prev Build on main (#28315108916)
  • Next Build on main (#28339727021)
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