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

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

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 18 Oct 2026 05:23AM 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 05:03AM UTC coverage: 87.325% (+0.007%) from 87.318%
39099246021

push

github

web-flow
fix(lns): sqrt is exact, the exponent halved and rounded to even (1729)

lns sqrt was lns(std::sqrt(double(a))) in both branches of an
LNS_NATIVE_SQRT switch, one of them marked "TBD". The value went
through double for the root and through std::log2 for the conversion
back, then took a second rounding into the exponent. That capped the
precision at a double's. It also decided every tie by noise: an odd
exponent has its root exactly halfway between two encodings.

An lns value is 2^(E 2^-rbits), and lns rounds in the exponent domain:
converting a real stores log2 rounded to the nearest multiple of
2^-rbits, ties to even. The correctly rounded root under that rule has
the exponent E/2 rounded to an integer, ties to even. It is computed
exactly with an arithmetic shift of the exponent field and a
two's-complement increment for a tie onto an odd value. Halving moves E
towards zero, so the result can neither overflow nor reach the zero
encoding. The switch is removed. A negative argument sets errno = EDOM
and returns NaN instead of printing to std::cerr, as std::sqrt does; it
still throws under LNS_THROW_ARITHMETIC_EXCEPTION.

static/logarithmic/lns/math/sqrt.cpp reads both exponents as integers
from the raw encodings. It requires |2 Er - Ea| <= 1, and an even Er
for a tie. It runs exhaustively over lns<8,2>, <10,4>, <12,0>, <16,8>
and a saturating <16,12>, and samples 50000 each of <32,22>, <48,40>
and <64,60>. It also checks the special values: 0, NaN, and a negative
argument (EDOM). On the old header every configuration fails: 3, 12,
1, 211, 3528, 38, 159 and 24699 cases.

The special-values check follows LNS_THROW_ARITHMETIC_EXCEPTION:
under the throwing configuration it expects lns_negative_sqrt_arg.

Relates to #1725

BEHAVIOUR-CHANGE: lns sqrt is now exact in the exponent domain (it went through double, capping precision at 53 bits and deciding every tie by rounding noise); a negative argument sets errno = EDOM and returns NaN without printing; LNS_... (continued)

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

1 existing line in 1 file now uncovered.

50872 of 58256 relevant lines covered (87.32%)

10448293.41 hits per line

Coverage Regressions

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