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

stillwater-sc / universal / 35940409374
87%
master: 84%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 24 Sep 2026 01:17AM UTC
Jobs 1
Files 676
Run time 2min
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

24 Sep 2026 12:52AM UTC coverage: 85.964% (+0.06%) from 85.907%
35940409374

push

github

web-flow
fix(cfloat): sqrt delivers the format's precision instead of a double's 53 bits (#1590)

cfloat's sqrt was `cfloat(std::sqrt((double)a))` in BOTH branches of the
CFLOAT_NATIVE_SQRT switch -- the first marked "// TBD" and character-for-
character identical to the second, with the macro defaulting to 0 in three
separate headers, so it was inert either way. The result carried 53 bits of
significand whatever the format asked for: 53 of 112 for quad, 53 of 236 for
octo, silently, with the trailing fraction an artifact of the widening rather
than anything computed. Arguments outside a double's exponent range were worse
than imprecise, because (double)a overflowed to infinity before std::sqrt was
ever called, so sqrt(maxpos) returned inf.

Now a Newton-Raphson iteration in the cfloat's own arithmetic, x = (x + a/x)/2,
which doubles the correct bits per step. The seed is std::sqrt(double(a)) when
the value is one a double can carry, and 2^floor(scale/2) otherwise, which is
within a factor of sqrt(2) of the root. Measured by squaring the root in a
wider cfloat: quad sqrt(2) goes from 53 bits to 112.5, octo sqrt(2) from 53 to
236.7, and quad sqrt(maxpos) from inf to a finite, exact root. Narrow formats
are bit-identical to the host across 40,000 comparisons.

Whether the host can answer is a property of the VALUE, not of the format's
fraction width. An earlier `fbits <= 52` guard routed cfloat<64,15> to the host
because its fraction is 48 bits, but es = 15 puts its maxpos past DBL_MAX and
its minpos below DBL_MIN, so that configuration kept returning inf and zero.
The gate is on the value now.

The IEEE special values are settled in the right order. isneg() is true for -0,
so testing the sign first returned NaN where IEEE 754 requires -0. NaN and zero
are handled before the sign test, and -inf is deliberately left to it, because
sqrt(-inf) IS NaN.

The regression suite squares the root in a cfloat wider in BOTH the fraction
and the exponent -- an oracle with th... (continued)

25 of 25 new or added lines in 1 file covered. (100.0%)

35 existing lines in 1 file now uncovered.

45473 of 52898 relevant lines covered (85.96%)

9323997.6 hits per line

Coverage Regressions

Lines Coverage ∆ File
35
95.22
1.68% include/sw/universal/number/cfloat/cfloat_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 35940409374.1 24 Sep 2026 01:17AM UTC 676
85.96
GitHub Action Run
Source Files on build 35940409374
  • Tree
  • List 676
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #35940409374
  • af411e9c on github
  • Prev Build on main (#35746543765)
  • Next Build on main (#36006265634)
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