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

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

Build:
Build:
LAST BUILD BRANCH: fix/issue-2128-lns-correct-rounding
DEFAULT BRANCH: master
Ran 18 Oct 2026 05:09AM UTC
Jobs 1
Files 751
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

18 Oct 2026 04:44AM UTC coverage: 87.318% (+0.02%) from 87.295%
39098120219

push

github

web-flow
fix(cfloat): sqrt is correctly rounded at every width; subnormals widen correctly (#1728)

sqrt of a cfloat of up to 52 fraction bits returned the host's root,
cfloat(std::sqrt(double(a))). That rounds twice, once to a double and
once to the format, which is innocuous only while the double carries
2p + 2 bits of a p-bit significand (fbits <= 24). Past that it
misrounded: 9 arguments in 10^5 for cfloat<48,8>, and 24852 in 99314
(25%) for cfloat<60,8>, whose 51-bit fraction leaves the double one
spare bit, so half its roots are exact midpoints. Wider formats ended
a Newton iteration at an oscillation without proving the last ulp
(49 of 191 IEEE quad roots wrong).

x is the correctly rounded root of a exactly when a lies between the
squares of the midpoints to x's neighbours; otherwise the root is a
neighbour. Every path now ends in that test:
- fbits <= 24: the host root, provably correct (Figueroa);
- fbits <= 51: the host root, corrected in doubles. A midpoint has at
  most 53 bits, two_prod gives its square exactly (Dekker's split, so
  an untrusted fma does not matter), and both sides are scaled by a
  power of four so nothing under- or overflows;
- fbits == 52 (fp64 and wider exponents): the host root, rounded once;
- wider, or outside a double's range: Newton, then the same test in a
  cfloat of 2 fbits + 4 fraction bits and a wider exponent, where the
  squares are exact.
The CFLOAT_NATIVE_SQRT switch is removed; the configuration alone picks
the path. A negative argument now sets errno = EDOM and returns a quiet
NaN instead of printing to std::cerr, as std::sqrt does.

The wide-format test exposed a conversion bug. cfloat's converting
constructor takes a bit-by-bit path when the target has 64 or more
fraction bits, and that path copied a subnormal source without
normalizing it. convert() read the leading 1 as the hidden bit, so
every subnormal converted into such a format came out wrong:
cfloat<40,8> 9.86e-39 became 2.16e-38. The path now normal... (continued)

63 of 65 new or added lines in 2 files covered. (96.92%)

3 existing lines in 2 files now uncovered.

50854 of 58240 relevant lines covered (87.32%)

10450122.14 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
97.44
-2.56% include/sw/universal/number/cfloat/math/functions/sqrt.hpp

Coverage Regressions

Lines Coverage ∆ File
2
82.83
-0.3% include/sw/universal/number/qd/qd_impl.hpp
1
97.04
0.66% include/sw/universal/number/cfloat/cfloat_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 39098120219.1 18 Oct 2026 05:09AM UTC 751
87.32
GitHub Action Run
Source Files on build 39098120219
  • Tree
  • List 751
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #39098120219
  • 4630718c on github
  • Prev Build on main (#39093502751)
  • Next Build on main (#39099246021)
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